MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / uniform_random_data

Function uniform_random_data

nodedb-codec/src/rans.rs:380–391  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

378
379 #[test]
380 fn uniform_random_data() {
381 // Uniform random → ~8 bits/byte → no compression possible.
382 let mut data = vec![0u8; 5000];
383 let mut rng: u64 = 12345;
384 for byte in &mut data {
385 rng = rng.wrapping_mul(6364136223846793005).wrapping_add(1);
386 *byte = (rng >> 33) as u8;
387 }
388 let encoded = encode(&data);
389 let decoded = decode(&encoded).unwrap();
390 assert_eq!(decoded, data);
391 }
392
393 #[test]
394 fn all_byte_values() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.70
decodeFunction · 0.70

Tested by

no test coverage detected