zstd 1.1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +64 -0
- data/Rakefile +19 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/zstd +3 -0
- data/ext/zstd/extconf.rb +20 -0
- data/ext/zstd/libzstd/.gitignore +2 -0
- data/ext/zstd/libzstd/LICENSE +1262 -0
- data/ext/zstd/libzstd/Makefile +133 -0
- data/ext/zstd/libzstd/PATENTS +1272 -0
- data/ext/zstd/libzstd/README.md +77 -0
- data/ext/zstd/libzstd/common/bitstream.h +414 -0
- data/ext/zstd/libzstd/common/entropy_common.c +227 -0
- data/ext/zstd/libzstd/common/error_private.c +43 -0
- data/ext/zstd/libzstd/common/error_private.h +76 -0
- data/ext/zstd/libzstd/common/fse.h +668 -0
- data/ext/zstd/libzstd/common/fse_decompress.c +329 -0
- data/ext/zstd/libzstd/common/huf.h +238 -0
- data/ext/zstd/libzstd/common/mem.h +372 -0
- data/ext/zstd/libzstd/common/xxhash.c +867 -0
- data/ext/zstd/libzstd/common/xxhash.h +309 -0
- data/ext/zstd/libzstd/common/zstd_common.c +77 -0
- data/ext/zstd/libzstd/common/zstd_errors.h +60 -0
- data/ext/zstd/libzstd/common/zstd_internal.h +270 -0
- data/ext/zstd/libzstd/compress/fse_compress.c +850 -0
- data/ext/zstd/libzstd/compress/huf_compress.c +609 -0
- data/ext/zstd/libzstd/compress/zstd_compress.c +3291 -0
- data/ext/zstd/libzstd/compress/zstd_opt.h +919 -0
- data/ext/zstd/libzstd/decompress/huf_decompress.c +885 -0
- data/ext/zstd/libzstd/decompress/zstd_decompress.c +2154 -0
- data/ext/zstd/libzstd/deprecated/zbuff.h +210 -0
- data/ext/zstd/libzstd/deprecated/zbuff_compress.c +145 -0
- data/ext/zstd/libzstd/deprecated/zbuff_decompress.c +74 -0
- data/ext/zstd/libzstd/dictBuilder/divsufsort.c +1913 -0
- data/ext/zstd/libzstd/dictBuilder/divsufsort.h +67 -0
- data/ext/zstd/libzstd/dictBuilder/zdict.c +1012 -0
- data/ext/zstd/libzstd/dictBuilder/zdict.h +111 -0
- data/ext/zstd/libzstd/dll/example/Makefile +47 -0
- data/ext/zstd/libzstd/dll/example/README.md +69 -0
- data/ext/zstd/libzstd/dll/example/build_package.bat +17 -0
- data/ext/zstd/libzstd/dll/example/fullbench-dll.sln +25 -0
- data/ext/zstd/libzstd/dll/example/fullbench-dll.vcxproj +179 -0
- data/ext/zstd/libzstd/dll/libzstd.def +86 -0
- data/ext/zstd/libzstd/legacy/zstd_legacy.h +259 -0
- data/ext/zstd/libzstd/legacy/zstd_v01.c +2095 -0
- data/ext/zstd/libzstd/legacy/zstd_v01.h +80 -0
- data/ext/zstd/libzstd/legacy/zstd_v02.c +3518 -0
- data/ext/zstd/libzstd/legacy/zstd_v02.h +79 -0
- data/ext/zstd/libzstd/legacy/zstd_v03.c +3159 -0
- data/ext/zstd/libzstd/legacy/zstd_v03.h +79 -0
- data/ext/zstd/libzstd/legacy/zstd_v04.c +3795 -0
- data/ext/zstd/libzstd/legacy/zstd_v04.h +128 -0
- data/ext/zstd/libzstd/legacy/zstd_v05.c +4056 -0
- data/ext/zstd/libzstd/legacy/zstd_v05.h +149 -0
- data/ext/zstd/libzstd/legacy/zstd_v06.c +4167 -0
- data/ext/zstd/libzstd/legacy/zstd_v06.h +159 -0
- data/ext/zstd/libzstd/legacy/zstd_v07.c +4540 -0
- data/ext/zstd/libzstd/legacy/zstd_v07.h +173 -0
- data/ext/zstd/libzstd/libzstd.pc.in +14 -0
- data/ext/zstd/libzstd/zstd.h +673 -0
- data/ext/zstd/zstd.c +185 -0
- data/ext/zstd/zstd.h +7 -0
- data/lib/zstd/version.rb +3 -0
- data/lib/zstd.rb +6 -0
- data/zstd.gemspec +38 -0
- metadata +172 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8ee8fdb967e8b166459a810926a43faccc529794
|
4
|
+
data.tar.gz: 204d340df70cd3110e62511fa220648a071129e4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8ba6977b618ac2267c710cad67e5c149066db58a0156701b084979dd1e25fc24bbdcc380ad52d5e1b0f44d828efd0a002ac440427f033dfbc144e9ee9d139807
|
7
|
+
data.tar.gz: a112a7b1971029ac3d51e81f0f3a2952d1041c25330a21b0d086e8c544b38dc6b069033772a68ef6aa61eea3bf11c6bbcd459a9e5875f934997d1fd06ecc6082
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Uwe Kubosch
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Zstd
|
2
|
+
|
3
|
+
**Zstd**, short for Zstandard, is a new lossless compression algorithm, which
|
4
|
+
provides both good compression ratio _and_ speed for your standard compression
|
5
|
+
needs.
|
6
|
+
|
7
|
+
**Zstd** is developed by Yann Collet and the source is available at:
|
8
|
+
https://github.com/facebook/zstd
|
9
|
+
|
10
|
+
This gem wraps the **Zstd** library and provides bindings for ruby.
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Add this line to your application's Gemfile:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
gem 'zstd'
|
18
|
+
```
|
19
|
+
|
20
|
+
And then execute:
|
21
|
+
|
22
|
+
$ bundle
|
23
|
+
|
24
|
+
Or install it yourself as:
|
25
|
+
|
26
|
+
$ gem install zstd
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'zstd'
|
32
|
+
|
33
|
+
# Compress example
|
34
|
+
zstd = Zstd.new
|
35
|
+
compressed_buffer = zstd.compress 'foo'
|
36
|
+
|
37
|
+
# Decompress example
|
38
|
+
decompressed_buffer = zstd.decompress compressed_buffer
|
39
|
+
|
40
|
+
# Dictionary example
|
41
|
+
zstd = Zstd.new '/tmp/dictionary'
|
42
|
+
zstd.compress 'foo'
|
43
|
+
zstd.decompress "(\xB5/\xFD#\x0E%5\x1A\x03\x19\x00\x00foo"
|
44
|
+
```
|
45
|
+
|
46
|
+
Dictionaries must be created using **Zstd** binary.
|
47
|
+
|
48
|
+
zstd --train FullPathToTrainingSet/* -o dictionaryName
|
49
|
+
|
50
|
+
**Zstd** can be obtained from: http://facebook.github.io/zstd/
|
51
|
+
|
52
|
+
Streaming is not supported, but may be added in the future.
|
53
|
+
|
54
|
+
Version numbers follow **Zstd** version numbers, with gem release version appended if needed (ie. 1.2.1.9 is **Zstd** version 1.2.1, gem release 9 within 1.2.1).
|
55
|
+
|
56
|
+
## Contributing
|
57
|
+
Feel free to contribute, standard fork and pull request is preferable.
|
58
|
+
|
59
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
60
|
+
|
61
|
+
## License
|
62
|
+
|
63
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
64
|
+
The native Zstd library is licensed under 3-clause BSD license with a patent grant. See the LICENSE and ext/zstd/libzstd/LICENSE for full copythight and conditions.
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
|
+
|
4
|
+
Rake::TestTask.new(:test) do |t|
|
5
|
+
t.libs << "test"
|
6
|
+
t.libs << "lib"
|
7
|
+
t.test_files = FileList['test/**/*_test.rb']
|
8
|
+
end
|
9
|
+
|
10
|
+
require "rake/extensiontask"
|
11
|
+
|
12
|
+
task :build => :compile
|
13
|
+
|
14
|
+
Rake::ExtensionTask.new("zstd") do |ext|
|
15
|
+
ext.lib_dir = "lib/zstd"
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => [:clobber, :compile, :test]
|
19
|
+
task test: :build
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "zstd"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/exe/zstd
ADDED
data/ext/zstd/extconf.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "mkmf"
|
2
|
+
|
3
|
+
$CFLAGS = '-I. -O3 -std=c99 -Wall -pedantic'
|
4
|
+
|
5
|
+
CDIRS = ['common', 'compress', 'decompress', 'dictBuilder']
|
6
|
+
|
7
|
+
Dir.chdir File.expand_path('..', __FILE__) do
|
8
|
+
$srcs = Dir['*.c']
|
9
|
+
|
10
|
+
CDIRS.each do |d|
|
11
|
+
$VPATH << "$(srcdir)/libzstd/#{d}"
|
12
|
+
$INCFLAGS << " -I$(srcdir)/libzstd/#{d}"
|
13
|
+
$srcs += Dir["libzstd/#{d}/*.c"]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
$INCFLAGS << " -I$(srcdir) -I$(srcdir)/libzstd"
|
18
|
+
$VPATH << "$(srcdir)"
|
19
|
+
|
20
|
+
create_makefile("zstd/zstd")
|