Import with #import "std/zstd_go".

Encoder :: struct
Decoder :: struct
EncoderOption :: struct
DecoderOption :: struct
EncoderLevel :: struct
EncoderResult :: struct { value: *Encoder; error: Error; }
DecoderResult :: struct { value: *Decoder; error: Error; }
NewEncoder :: (writer: io.Writer, level: isize, window_bytes: isize, literal_entropy: bool) -> EncoderResult

Literal entropy matters for data such as base64, even without repeated strings. The provider's numeric levels select its nearest preset, not native zstd effort.

Reset :: (encoder: *Encoder, writer: io.Writer)
CloseEncoder :: (encoder: *Encoder) -> Error
DecodeLimited :: (input: []u8, limit: s64, window_bytes: u64) -> io.ReadAllResult

Streaming decompression limits both the advertised window and returned bytes. Read one extra decoded byte so an expansion beyond the caller's limit fails.

Source ↗ · All modules