Skip to content

zstdTrainDictionary

zstdTrainDictionary(samples, maxDictSize?): Buffer

Defined in: index.d.ts:1820

Train a zstd dictionary from sample data.

The dictionary can be used with zstdCompressWithDict and zstdDecompressWithDict to achieve better compression ratios on small, similar data.

maxDictSize is optional and defaults to 110 KB (the zstd default). It must not exceed 16 MiB (16777216 bytes).

(Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>)[]

number | null

Buffer