Add archive helpers and harden task runtime
This commit is contained in:
1 parent
9f7625c7fd
commit
02e153a6a7
71 files changed
+12817
-305
No files matched your search
@@ -0,0 +1,22 @@
|
||||
:sig
|
||||
String gz_uncompress(String compressed)
|
||||
|
||||
:params
|
||||
compressed : gzip-format compressed bytes
|
||||
return value : uncompressed bytes
|
||||
|
||||
:see
|
||||
>sys
|
||||
gz_compress
|
||||
zip_list
|
||||
zip_extract
|
||||
|
||||
:content
|
||||
Uncompresses a gzip-format byte string and returns the original content.
|
||||
|
||||
```uce
|
||||
String compressed = file_get_contents("/tmp/hello.txt.gz");
|
||||
String plain = gz_uncompress(compressed);
|
||||
```
|
||||
|
||||
`gz_uncompress()` validates the gzip header, CRC32 footer, and uncompressed-size footer. It throws a runtime error when the input is not a supported gzip stream or fails validation.
|
||||
Reference in new issue
Block a user