1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vlib/compress: correct comments in compress module (#18434)

This commit is contained in:
yuyi 2023-06-14 00:10:27 +08:00 committed by GitHub
parent 285000699b
commit 530f73b927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -3,13 +3,13 @@ module deflate
import compress as compr
// compresses an array of bytes using deflate and returns the compressed bytes in a new array
// Example: compressed := deflate.compress(b)?
// Example: compressed := deflate.compress(b)!
pub fn compress(data []u8) ![]u8 {
return compr.compress(data, 0)
}
// decompresses an array of bytes using deflate and returns the decompressed bytes in a new array
// Example: decompressed := deflate.decompress(b)?
// Example: decompressed := deflate.decompress(b)!
pub fn decompress(data []u8) ![]u8 {
return compr.decompress(data, 0)
}

View File

@ -7,7 +7,7 @@ import compress as compr
import hash.crc32
// compresses an array of bytes using gzip and returns the compressed bytes in a new array
// Example: compressed := gzip.compress(b)?
// Example: compressed := gzip.compress(b)!
pub fn compress(data []u8) ![]u8 {
compressed := compr.compress(data, 0)!
// header
@ -134,7 +134,7 @@ pub fn validate(data []u8, params DecompressParams) !GzipHeader {
}
// decompresses an array of bytes using zlib and returns the decompressed bytes in a new array
// Example: decompressed := gzip.decompress(b)?
// Example: decompressed := gzip.decompress(b)!
pub fn decompress(data []u8, params DecompressParams) ![]u8 {
gzip_header := validate(data, params)!
header_length := gzip_header.length

View File

@ -3,14 +3,14 @@ module zlib
import compress as compr
// compresses an array of bytes using zlib and returns the compressed bytes in a new array
// Example: compressed := zlib.compress(b)?
// Example: compressed := zlib.compress(b)!
pub fn compress(data []u8) ![]u8 {
// flags = TDEFL_WRITE_ZLIB_HEADER (0x01000)
return compr.compress(data, 0x01000)
}
// decompresses an array of bytes using zlib and returns the decompressed bytes in a new array
// Example: decompressed := zlib.decompress(b)?
// Example: decompressed := zlib.decompress(b)!
pub fn decompress(data []u8) ![]u8 {
// flags = TINFL_FLAG_PARSE_ZLIB_HEADER (0x1)
return compr.decompress(data, 0x1)