{"id":18791783,"url":"https://github.com/phip1611/bit_ops","last_synced_at":"2025-04-13T14:24:40.181Z","repository":{"id":248246532,"uuid":"826867061","full_name":"phip1611/bit_ops","owner":"phip1611","description":"Bitwise operations on primitive integer types, but no_std and const-compatible. Provides a collection of typical bit manipulation operations that are primarily required in low-level development. Unlike other crates that provide tooling to create sophisticated high-level types with bitfields, the focus of bit_ops is to work on raw integers.","archived":false,"fork":false,"pushed_at":"2025-04-01T05:10:17.000Z","size":73,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T11:19:14.219Z","etag":null,"topics":["bitwise","rust"],"latest_commit_sha":null,"homepage":"","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/phip1611.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2024-07-10T14:35:02.000Z","updated_at":"2025-04-01T05:10:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"3be61221-49ed-44dd-9ce2-3a2e14642e0f","html_url":"https://github.com/phip1611/bit_ops","commit_stats":null,"previous_names":["phip1611/bit_ops"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phip1611%2Fbit_ops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phip1611%2Fbit_ops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phip1611%2Fbit_ops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phip1611%2Fbit_ops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phip1611","download_url":"https://codeload.github.com/phip1611/bit_ops/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248726081,"owners_count":21151847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bitwise","rust"],"created_at":"2024-11-07T21:16:50.765Z","updated_at":"2025-04-13T14:24:40.156Z","avatar_url":"https://github.com/phip1611.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bit_ops\n\nCommon bit-oriented operations on primitive integer types with a focus on\n`no_std` and `const` compatibility. Unlike other crates that provide tooling to\ncreate sophisticated high-level types with bitfields, the focus of `bit_ops` is\non raw primitive integer types.\n\n# Documentation\n\nSee \u003chttps://docs.rs/bit_ops\u003e.\n\n# Example\n\n\u003c!-- copied from lib.rs --\u003e\n```rust\nfn main() {\n    // PREREQUISITES: Some Definitions\n\n    /// See specification of the x86 IOAPIC redirection entry for more details.\n    mod x86_ioapic {\n        pub const VECTOR_BITS: u64 = 8;\n        pub const VECTOR_SHIFT: u64 = 0;\n        pub const DELIVERY_MODE_BITS: u64 = 3;\n        pub const DELIVERY_MODE_SHIFT: u64 = 8;\n        pub const DESTINATION_MODE_BITS: u64 = 1;\n        pub const DESTINATION_MODE_SHIFT: u64 = 11;\n        pub const PIN_POLARITY_BITS: u64 = 1;\n        pub const PIN_POLARITY_SHIFT: u64 = 13;\n        pub const TRIGGER_MODE_BITS: u64 = 1;\n        pub const TRIGGER_MODE_SHIFT: u64 = 15;\n        pub const MASKED_BITS: u64 = 1;\n        pub const MASKED_SHIFT: u64 = 16;\n        pub const DESTINATION_BITS: u64 = 8;\n        pub const DESTINATION_SHIFT: u64 = 56;\n    }\n\n    use x86_ioapic::*;\n\n    // ACTUAL LIBRARY USAGE BEGINS HERE\n\n    let redirection_entry = bit_ops::bitops_u64::set_bits_exact_n(\n        0,\n        \u0026[\n            (7, VECTOR_BITS, VECTOR_SHIFT),\n            (0b111 /* ExtInt */, DELIVERY_MODE_BITS, DELIVERY_MODE_SHIFT),\n            (0 /* physical */, DESTINATION_MODE_BITS, DESTINATION_MODE_SHIFT),\n            (1 /* low-active */, PIN_POLARITY_BITS, PIN_POLARITY_SHIFT),\n            (1 /* level-triggered */, TRIGGER_MODE_BITS, TRIGGER_MODE_SHIFT),\n            (1 /* masked */, MASKED_BITS, MASKED_SHIFT),\n            (13 /* APIC ID */, DESTINATION_BITS, DESTINATION_SHIFT),\n        ],\n    );\n    assert_eq!(redirection_entry, 0xd0000000001a707);\n}\n```\n\n## MSRV\n\n\u003c!-- Keep in sync with lib.rs and Cargo.toml!  --\u003e\n1.57.0 stable\n\n## License\n\nMIT License. See [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphip1611%2Fbit_ops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphip1611%2Fbit_ops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphip1611%2Fbit_ops/lists"}