mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
zlib: add dictionary support to zstdCompress and zstdDecompress
Adds optional dictionary support to zlib’s zstdCompress and zstdDecompress APIs. This enables better compression ratios when the dictionary matches expected input structure or content patterns. The implementation allows passing a `dictionary` buffer through the options object. Support was added to both streaming and convenience methods. Tests and documentation were also updated to reflect this new capability. Fixes: https://github.com/nodejs/node/issues/59105 PR-URL: https://github.com/nodejs/node/pull/59240 Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
f7c2a7ed4a
commit
b8e643259e
4 changed files with 79 additions and 7 deletions
|
@ -1069,6 +1069,9 @@ Each Zstd-based class takes an `options` object. All options are optional.
|
|||
* `maxOutputLength` {integer} Limits output size when using
|
||||
[convenience methods][]. **Default:** [`buffer.kMaxLength`][]
|
||||
* `info` {boolean} If `true`, returns an object with `buffer` and `engine`. **Default:** `false`
|
||||
* `dictionary` {Buffer} Optional dictionary used to
|
||||
improve compression efficiency when compressing or decompressing data that
|
||||
shares common patterns with the dictionary.
|
||||
|
||||
For example:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue