zstd-native-ruby

Ruby bindings for Facebook's Zstandard (zstd) compression library with bundled native library.

This gem bundles the zstd C library, so you don't need to install zstd separately on your system. It provides native performance with simple Ruby API for file compression and decompression.

Installation

Install from RubyGems:

gem install zstd-native-ruby

Or add to your Gemfile:

gem 'zstd-native-ruby'

Usage

require 'zstd_ruby'

# Compress a file
ZstdRuby.compress_file('input.txt', 'output.txt.zst', level: 3)

# Decompress a file
ZstdRuby.decompress_file('output.txt.zst', 'decompressed.txt')

Compression Levels

Zstd supports compression levels from 1 (fastest) to 22 (best compression). The default level is 3.

Development

bundle install
rake compile
rake test

License

MIT License