MCPcopy Create free account
hub / github.com/BitVM/BitVM / u32_to_bits_vec

Function u32_to_bits_vec

bitvm/src/chunk/taps_msm.rs:191–197  ·  view source on GitHub ↗
(value: u32, window: usize)

Source from the content-addressed store, hash-verified

189 use rand_chacha::ChaCha20Rng;
190
191 fn u32_to_bits_vec(value: u32, window: usize) -> Vec<u8> {
192 let mut bits = Vec::with_capacity(window);
193 for i in (0..window).rev() {
194 bits.push(((value >> i) & 1) as u8);
195 }
196 bits
197 }
198
199 #[test]
200 fn test_precompute_table() {

Callers 1

test_precompute_tableFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by 1

test_precompute_tableFunction · 0.68