https://github.com/dearblue/ruby-extbrotli
ruby bindings for brotli
https://github.com/dearblue/ruby-extbrotli
Last synced: about 2 months ago
JSON representation
ruby bindings for brotli
- Host: GitHub
- URL: https://github.com/dearblue/ruby-extbrotli
- Owner: dearblue
- License: other
- Created: 2017-03-08T11:40:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-08T13:34:10.000Z (about 8 years ago)
- Last Synced: 2025-02-12T11:34:49.818Z (4 months ago)
- Language: C
- Size: 420 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# encoding:utf-8 ;
# extbrotli - ruby bindings for Brotli
This is ruby bindings for compression library
[Brotli (https://github.com/google/brotli)](https://github.com/google/brotli).* package name: extbrotli
* author: dearblue (mailto:[email protected])
* version: 0.0.1.PROTOTYPE
* software quality: EXPERIMENTAL
* license: 2-clause BSD License
* report issue to:
* dependency ruby: ruby-2.0+
* dependency ruby gems: (none)
* dependency libraries: (none)
* bundled external libraries:
* brotli-0.2## HOW TO USE (***a stub***)
### basic usage (one pass encode/decode)
``` ruby:ruby
# First, load library
require "extbrotli"# Prepair data
source = "sample data..." * 50# Directly compression
encdata = Brotli.encode(source)
puts "encdata.bytesize=#{encdata.bytesize}"# Directly decompression
decdata = Brotli.decode(encdata)
puts "decdata.bytesize=#{decdata.bytesize}"# Comparison source and decoded data
p source == decdata # => true
```### Fastest encoding
``` ruby:ruby
best_speed = 0
Brotli.encode(source, quality: best_speed)
```### Highest encoding
``` ruby:ruby
best_compression = 11
Brotli.encode(source, quality: best_compression)
```### Data decoding with limitation size
``` ruby:ruby
maxdestsize = 5 # as byte size
Brotli.decode(brotli_data, maxdestsize)
```----
[a stub]