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:
parent
285000699b
commit
530f73b927
@ -3,13 +3,13 @@ module deflate
|
|||||||
import compress as compr
|
import compress as compr
|
||||||
|
|
||||||
// compresses an array of bytes using deflate and returns the compressed bytes in a new array
|
// 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 {
|
pub fn compress(data []u8) ![]u8 {
|
||||||
return compr.compress(data, 0)
|
return compr.compress(data, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// decompresses an array of bytes using deflate and returns the decompressed bytes in a new array
|
// 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 {
|
pub fn decompress(data []u8) ![]u8 {
|
||||||
return compr.decompress(data, 0)
|
return compr.decompress(data, 0)
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import compress as compr
|
|||||||
import hash.crc32
|
import hash.crc32
|
||||||
|
|
||||||
// compresses an array of bytes using gzip and returns the compressed bytes in a new array
|
// 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 {
|
pub fn compress(data []u8) ![]u8 {
|
||||||
compressed := compr.compress(data, 0)!
|
compressed := compr.compress(data, 0)!
|
||||||
// header
|
// 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
|
// 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 {
|
pub fn decompress(data []u8, params DecompressParams) ![]u8 {
|
||||||
gzip_header := validate(data, params)!
|
gzip_header := validate(data, params)!
|
||||||
header_length := gzip_header.length
|
header_length := gzip_header.length
|
||||||
|
@ -3,14 +3,14 @@ module zlib
|
|||||||
import compress as compr
|
import compress as compr
|
||||||
|
|
||||||
// compresses an array of bytes using zlib and returns the compressed bytes in a new array
|
// 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 {
|
pub fn compress(data []u8) ![]u8 {
|
||||||
// flags = TDEFL_WRITE_ZLIB_HEADER (0x01000)
|
// flags = TDEFL_WRITE_ZLIB_HEADER (0x01000)
|
||||||
return compr.compress(data, 0x01000)
|
return compr.compress(data, 0x01000)
|
||||||
}
|
}
|
||||||
|
|
||||||
// decompresses an array of bytes using zlib and returns the decompressed bytes in a new array
|
// 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 {
|
pub fn decompress(data []u8) ![]u8 {
|
||||||
// flags = TINFL_FLAG_PARSE_ZLIB_HEADER (0x1)
|
// flags = TINFL_FLAG_PARSE_ZLIB_HEADER (0x1)
|
||||||
return compr.decompress(data, 0x1)
|
return compr.decompress(data, 0x1)
|
||||||
|
Loading…
Reference in New Issue
Block a user