Skip to content

zstdTrainDictionaryAsync

zstdTrainDictionaryAsync(samples, maxDictSize?): Promise<Buffer<ArrayBufferLike>>

Defined in: index.d.ts:1831

Asynchronously 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

Promise<Buffer<ArrayBufferLike>>