Compress raw bytes using Zstd at the default level (3).
(data: &[u8])
| 36 | |
| 37 | /// Compress raw bytes using Zstd at the default level (3). |
| 38 | pub fn encode(data: &[u8]) -> Result<Vec<u8>, CodecError> { |
| 39 | encode_with_level(data, DEFAULT_LEVEL) |
| 40 | } |
| 41 | |
| 42 | /// Compress raw bytes using Zstd at a specific level (1-22). |
| 43 | pub fn encode_with_level(data: &[u8], level: i32) -> Result<Vec<u8>, CodecError> { |