#bin #int #convert #test #bin-u64 #u64-bin

intbin

convert int to bin / bin to int

3 unstable releases

0.1.2 Nov 16, 2023
0.1.1 Nov 16, 2023
0.0.5 Aug 19, 2023

#53 in #int

Download history 26/week @ 2024-06-23 65/week @ 2024-06-30 28/week @ 2024-07-07 116/week @ 2024-07-14 9/week @ 2024-07-21 53/week @ 2024-07-28 215/week @ 2024-08-04 52/week @ 2024-08-11 52/week @ 2024-08-18 29/week @ 2024-08-25 92/week @ 2024-09-01 34/week @ 2024-09-08 17/week @ 2024-09-15 31/week @ 2024-09-22 23/week @ 2024-09-29 5/week @ 2024-10-06

82 downloads per month
Used in 10 crates (6 directly)

Apache-2.0

8KB
152 lines

intbin : convert int to bin / bin to int

→ tests/main.rs

use intbin::{bin_u64, u64_bin};

#[test]
fn main() {
  let bin = u64_bin(987654321);
  dbg!(&bin);
  dbg!(bin_u64(bin));
}

run

→ out.txt

+ cargo test -- --nocapture
   Compiling intbin v0.1.1 (/Users/z/art/intbin)
    Finished test [unoptimized + debuginfo] target(s) in 0.12s
     Running unittests src/lib.rs (target/debug/deps/intbin-ffe375fcab040bbd)
     Running tests/main.rs (target/debug/deps/main-5e93df032d50e825)
[tests/main.rs:6] &bin = [
    177,
    104,
    222,
    58,
]
[tests/main.rs:7] bin_u64(bin) = 987654321
   Doc-tests intbin

No runtime deps