2022-06-05 07:48:38 +02:00
|
|
|
module deflate
|
2022-06-03 08:00:11 +02:00
|
|
|
|
|
|
|
import compress
|
|
|
|
|
2022-06-05 17:53:45 +02: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 08:00:11 +02:00
|
|
|
pub fn compress(data []u8) ?[]u8 {
|
|
|
|
return compress.compress(data, 0)
|
|
|
|
}
|
|
|
|
|
2022-06-05 17:53:45 +02: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 08:00:11 +02:00
|
|
|
pub fn decompress(data []u8) ?[]u8 {
|
|
|
|
return compress.decompress(data, 0)
|
|
|
|
}
|