2022-06-05 08:48:38 +03:00
|
|
|
module deflate
|
2022-06-03 09:00:11 +03:00
|
|
|
|
2023-02-08 21:37:04 +03:00
|
|
|
import compress as compr
|
2022-06-03 09:00:11 +03:00
|
|
|
|
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-10-20 22:14:33 +03:00
|
|
|
pub fn compress(data []u8) ![]u8 {
|
2023-02-08 21:37:04 +03:00
|
|
|
return compr.compress(data, 0)
|
2022-06-03 09:00:11 +03:00
|
|
|
}
|
|
|
|
|
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-10-20 22:14:33 +03:00
|
|
|
pub fn decompress(data []u8) ![]u8 {
|
2023-02-08 21:37:04 +03:00
|
|
|
return compr.decompress(data, 0)
|
2022-06-03 09:00:11 +03:00
|
|
|
}
|