{"id":20122860,"url":"https://github.com/freaky/rust-bitrw","last_synced_at":"2026-05-28T23:31:21.427Z","repository":{"id":142942558,"uuid":"129966403","full_name":"Freaky/rust-bitrw","owner":"Freaky","description":"A Rust library for bit-level reading and writing","archived":false,"fork":false,"pushed_at":"2018-04-22T17:35:47.000Z","size":8,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-01T00:22:16.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Freaky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-17T21:18:30.000Z","updated_at":"2022-09-13T17:22:50.000Z","dependencies_parsed_at":"2023-04-07T07:00:56.786Z","dependency_job_id":null,"html_url":"https://github.com/Freaky/rust-bitrw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Freaky/rust-bitrw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frust-bitrw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frust-bitrw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frust-bitrw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frust-bitrw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freaky","download_url":"https://codeload.github.com/Freaky/rust-bitrw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frust-bitrw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33630999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T19:41:31.019Z","updated_at":"2026-05-28T23:31:21.409Z","avatar_url":"https://github.com/Freaky.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitrw [![Build Status](https://travis-ci.org/Freaky/rust-bitrw.svg?branch=master)](https://travis-ci.org/Freaky/rust-bitrw)\n\nA Rust crate for bit-level IO.\n\n## Synopsis\n\n    extern crate bitrw;\n    use bitrw::{BitReader, BitWriter};\n\n    // Something implementing io::Write\n  \tlet buf: Vec\u003cu8\u003e = Vec::new();\n\n    let mut writer = BitWriter::new(BufWriter::new(buf));\n\n    let mut bits_written = writer.write_bit(0)?;\n    bits_written += writer.write_bits(7, 0b100_0001)?;\n    bits_written += writer.write_bits(2, 0b01)?;\n    bits_written += writer.flush()?; // returns u64 indicating the number of bits of padding.\n\n    assert_eq!(buf, [0b0100_0001, 0b0100_0000]);\n\n    // Or io::Read, and optionally io::Seek for seeking by bit position.\n    let mut reader = BitReader::new(Cursor::new(writer.into_inner()));\n\n    let bit = reader.read_bit()?; // u8, 0 or 1\n    let rest_of_byte = reader.read_bits(7)?; // u64 of remainder.\n    let bits = reader.read_bits(2)?;\n\n    assert_eq!(bit, 0_u8);\n    assert_eq!(rest_of_byte, 0b100_0001_u64);\n    assert_eq!(bits, 0b01_u64);\n\n\nCurrently the interface can be considered unstable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Frust-bitrw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreaky%2Frust-bitrw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Frust-bitrw/lists"}