# zstd

> zstd, a magmalake tin: A Mojo binding to libzstd — one-shot and streaming, both directions — through a small C shim loaded at runtime, so consumers need no link flags.

[magmalake](https://magmalake.dev/) [zstd](https://magmalake.dev/s/zstd)

A Mojo binding to libzstd — one-shot and streaming, both directions — through a small C shim loaded at runtime, so consumers need no link flags.

Install

```
pixi shelf add zstd-mojo
```

Version

`0.1.5` on mojoshelf

Source

[GitHub](https://github.com/magmalake/zstd.mojo) [README](https://github.com/magmalake/zstd.mojo#readme) [Benchmark history](https://magmalake.github.io/zstd.mojo/benchmarks/)

## Works today

- One-shot and streaming compress and decompress
- Frame introspection: is\_zstd\_frame, frame\_content\_size
- The shim is dlopen'd once, not per call

Checked against Python zstandard, against independently produced frames baked in as constants

- [thrift](https://magmalake.dev/s/thrift) compact + binary protocol
- [lz4](https://magmalake.dev/s/lz4) liblz4
- [brotli](https://magmalake.dev/s/brotli) libbrotli
- [snappy](https://magmalake.dev/s/snappy) pure Mojo
- [deflate](https://magmalake.dev/s/deflate) DEFLATE · gzip · pure Mojo
- [hashes](https://magmalake.dev/s/hashes) CRC-32 · murmur3 · XXH64
- [memory-region](https://magmalake.dev/s/memory-region) bytes addressed by offset · shared mappings
- [threads](https://magmalake.dev/s/threads) pthreads · atomics · parallel\_for
- [Every tin](https://magmalake.dev/tins)

[A magmalake project](https://magmalake.dev/)

Apache 2.0 · © 2026 Marius Seritan
