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

Function compression_level

nodedb-codec/src/zstd_codec.rs:83–91  ·  view source on GitHub ↗

Get the compression level from the header.

(data: &[u8])

Source from the content-addressed store, hash-verified

81
82/// Get the compression level from the header.
83pub fn compression_level(data: &[u8]) -> Result<i32, CodecError> {
84 if data.len() < HEADER_SIZE {
85 return Err(CodecError::Truncated {
86 expected: HEADER_SIZE,
87 actual: data.len(),
88 });
89 }
90 Ok(data[4] as i32)
91}
92
93// ---------------------------------------------------------------------------
94// Platform-specific compression / decompression

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected