2022-06-05 08:48:38 +03:00
|
|
|
module deflate
|
2022-06-03 09:00:11 +03:00
|
|
|
|
|
|
|
import compress
|
|
|
|
|
2022-06-05 18:53:45 +03:00
|
|
|
// compresses an array of bytes using deflate and returns the compressed bytes in a new array
|
|
|
|
// Example: compressed := deflate.compress(b)?
|
2022-06-03 09:00:11 +03:00
|
|
|
pub fn compress(data []u8) ?[]u8 {
|
|
|
|
return compress.compress(data, 0)
|
|
|
|
}
|
|
|
|
|
2022-06-05 18:53:45 +03:00
|
|
|
// decompresses an array of bytes using deflate and returns the decompressed bytes in a new array
|
|
|
|
// Example: decompressed := deflate.decompress(b)?
|
2022-06-03 09:00:11 +03:00
|
|
|
pub fn decompress(data []u8) ?[]u8 {
|
|
|
|
return compress.decompress(data, 0)
|
|
|
|
}
|