MCPcopy
hub / github.com/klauspost/compress / WithEncoderDict

Function WithEncoderDict

zstd/encoder_options.go:382–391  ·  view source on GitHub ↗

WithEncoderDict allows to register a dictionary that will be used for the encode. The slice dict must be in the [dictionary format] produced by "zstd --train" from the Zstandard reference implementation. The encoder *may* choose to use no dictionary instead for certain payloads. Can be changed wit

(dict []byte)

Source from the content-addressed store, hash-verified

380//
381// [dictionary format]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format
382func WithEncoderDict(dict []byte) EOption {
383 return func(o *encoderOptions) error {
384 d, err := loadDict(dict)
385 if err != nil {
386 return err
387 }
388 o.dict = d
389 return nil
390 }
391}
392
393// WithEncoderDictRaw registers a dictionary that may be used by the encoder.
394//

Callers 7

FuzzEncodingFunction · 0.85
TestEncoder_SmallDictFunction · 0.85
BuildDictFunction · 0.85

Calls 1

loadDictFunction · 0.85

Tested by 6

FuzzEncodingFunction · 0.68
TestEncoder_SmallDictFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…