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

Function custom_block_size

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

Source from the content-addressed store, hash-verified

386
387 #[test]
388 fn custom_block_size() {
389 let data = vec![42u8; 10_000];
390 let encoded = encode_with_block_size(&data, 1024);
391 let decoded = decode(&encoded).unwrap();
392 assert_eq!(decoded, data);
393
394 let block_count = Lz4Decoder::block_count(&encoded).unwrap();
395 assert_eq!(block_count, 10); // 10000 / 1024 rounded up
396 }
397
398 #[test]
399 fn truncated_input_errors() {

Callers

nothing calls this directly

Calls 3

encode_with_block_sizeFunction · 0.85
block_countFunction · 0.85
decodeFunction · 0.70

Tested by

no test coverage detected