intbin

Crates.iointbin
lib.rsintbin
version0.1.2
sourcesrc
created_at2023-08-19 00:03:51.245787
updated_at2023-11-16 03:06:07.982624
descriptionconvert int to bin / bin to int
homepagehttps://github.com/xxai-art/intbin
repositoryhttps://github.com/xxai-art/intbin
max_upload_size
id948408
size8,749
(3tieto)

documentation

README

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
Commit count: 2

cargo fmt