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

Function incompressible_data

nodedb-codec/src/lz4.rs:360–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

358
359 #[test]
360 fn incompressible_data() {
361 // Random bytes — LZ4 may expand slightly but shouldn't fail.
362 let mut data = vec![0u8; 10_000];
363 let mut rng: u64 = 9999;
364 for byte in &mut data {
365 rng = rng.wrapping_mul(6364136223846793005).wrapping_add(1);
366 *byte = (rng >> 33) as u8;
367 }
368 let encoded = encode(&data);
369 let decoded = decode(&encoded).unwrap();
370 assert_eq!(decoded, data);
371 }
372
373 #[test]
374 fn streaming_encoder() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.70
decodeFunction · 0.70

Tested by

no test coverage detected