Expand description
§bits128
bits128
provides a struct that let’s you use 128 bits while taking only 128 bits in memory.
if you would use something like [bool; 128]
it would take 128*8 bits in memory because every bool takes 1 bytes(8bits)
You can easily iterate it by looping over the struct or by manually calling iter()
/ into_iter()
§Examples
let bits = Bits128::from_dec(1337);
for (bit, c) in bits.enumarate() {
if bit {
println!("the {}th bit is on", bit);
]
}