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

Function compress_native

nodedb-codec/src/zstd_codec.rs:98–102  ·  view source on GitHub ↗
(data: &[u8], level: i32)

Source from the content-addressed store, hash-verified

96
97#[cfg(not(target_arch = "wasm32"))]
98fn compress_native(data: &[u8], level: i32) -> Result<Vec<u8>, CodecError> {
99 zstd::encode_all(std::io::Cursor::new(data), level).map_err(|e| CodecError::CompressFailed {
100 detail: format!("zstd compress: {e}"),
101 })
102}
103
104#[cfg(not(target_arch = "wasm32"))]
105fn decompress_native(frame: &[u8], expected_size: usize) -> Result<Vec<u8>, CodecError> {

Callers 1

encode_with_levelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected