digest-xxhash 0.1.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 155293f54dc37486a7827e7356f3758f0cd411e444a66be7e35058e7f6ed742e
4
- data.tar.gz: 5c304167f2978dec00ed022c985360af16bcd91581f35a280a2c42aa7a4f5555
3
+ metadata.gz: 62b0480e6329d7a6f65173ab69262e2c3a0b26fed7d0eaa5d3500c86139b7103
4
+ data.tar.gz: 619a548d378beb8c0ab223843451452ea834272bb8df69971ecabf5bd6bd0ec7
5
5
  SHA512:
6
- metadata.gz: 510fd4a123c89d68eeb45a263f120dd85e88aa2dca4ca747f4231195dbb1687d77b997a50d3675a2627607f55b22a4134a231c73a7fbf312cef8e6a8676cf846
7
- data.tar.gz: 22dd84864a3bace71d39cd0886d13d74d867b680b6b28fc72d684ff98c169632e1de22758b1063c1514d795caacd019edf6281b480bf78175d8d7ecf7201b099
6
+ metadata.gz: 35b10f17d3d35c0b43662cc37c50b3bf3e008fc8305a3a6357c10f5fd588be3b56a75acd7e6feaeec409455691a010ef112543dbe454c6be66e7217efc26fda0
7
+ data.tar.gz: 995863f40af717ec3ba53f7e2429ed01d43ae677aeca1ac5ef9b29b998c1099cf995a3bc81d89a30862bd265cd3c752b999fe75037f07d86425561621bcd7ca2
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017 konsolebox
1
+ Copyright (c) 2021 konsolebox
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
- # digest-xxhash-ruby
1
+ # digest-xxhash
2
2
 
3
- This gem 'digest-xxhash' provides XXH32 and XXH64 functions for Ruby. It works
4
- on top of Digest::Class and complies with the functional design of
5
- Digest::Instance.
3
+ This gem provides XXH32, XXH64, XXH3_64bits and XXH3_128bits
4
+ functionalities for Ruby. It inherits Digest::Class and complies
5
+ with Digest::Instance's functional design.
6
6
 
7
- Its core implementation was taken from the official source, which is
8
- in https://github.com/Cyan4973/xxHash.
7
+ Its core implementation comes from the official source, which is in
8
+ https://github.com/Cyan4973/xxHash.
9
9
 
10
10
  ## Installation
11
11
 
12
- Add this line to your application's Gemfile:
12
+ Add this line to the application's Gemfile:
13
13
 
14
14
  gem 'digest-xxhash'
15
15
 
@@ -17,10 +17,21 @@ And then execute:
17
17
 
18
18
  $ bundle
19
19
 
20
- Or install it yourself as:
20
+ It can also be installed manually with:
21
21
 
22
22
  $ gem install digest-xxhash
23
23
 
24
+ The library can also be installed in Gentoo system-wide using 'layman':
25
+
26
+ # Fetch remote list of overlays, and add 'konsolebox' overlay
27
+ layman -f && layman -a konsolebox
28
+
29
+ # Unmask unstable keyword
30
+ echo 'dev-ruby/digest-xxhash' > /etc/portage/package.keywords/dev-ruby.digest-xxhash
31
+
32
+ # Merge package
33
+ emerge dev-ruby/digest-xxhash
34
+
24
35
  ## Example Usage
25
36
 
26
37
  require 'digest/xxhash'
@@ -52,13 +63,34 @@ Or install it yourself as:
52
63
  Digest::XXH64.new.reset("0123456789abcdef").update("12").update("34").hexdigest
53
64
  => "d7544504de216507"
54
65
 
66
+ Digest::XXH3_64bits.hexdigest("1234", "0123456789abcdef")
67
+ => "4156724c7605b1be"
68
+
69
+ Digest::XXH3_64bits.new.reset_with_secret("abcd" * 34).update("1234").hexdigest
70
+ => "f7bbdbf9ec8c6394"
71
+
72
+ Digest::XXH3_128bits.hexdigest("1234", "0123456789abcdef") # XXH3_128bits() only allows 64-bit seeds
73
+ => "ad6108fb0b9a6b51b7f80d053c76c0fd"
74
+
75
+ Digest::XXH3_128bits.new.reset_with_secret("abcd" * 34).update("1234").hexdigest
76
+ => "0d44dd7fde8ea2b4ba961e1a26f71f21"
77
+
78
+ ## API Documentation
79
+
80
+ RubyGems.org provides autogenerated API documentation of the library in
81
+ https://www.rubydoc.info/gems/digest-xxhash/.
82
+
83
+ ## Homepage
84
+
85
+ https://rubygems.org/gems/digest-xxhash
86
+
55
87
  ## Contributing
56
88
 
57
89
  1. Fork it ( https://github.com/konsolebox/digest-xxhash-ruby/fork ).
58
- 2. Create your feature branch (`git checkout -b my-new-feature`).
59
- 3. Commit your changes (`git commit -am 'Add some feature'`).
90
+ 2. Create feature branch (`git checkout -b my-new-feature`).
91
+ 3. Commit changes (`git commit -am 'Add some feature'`).
60
92
  4. Push to the branch (`git push origin my-new-feature`).
61
93
  5. Create a new Pull Request.
62
94
 
63
- [![Build Status](https://travis-ci.org/konsolebox/digest-xxhash-ruby.svg?branch=master)](https://travis-ci.org/konsolebox/digest-xxhash-ruby)
64
- [![Build status](https://ci.appveyor.com/api/projects/status/kb6hvlxjms3ftw7u?svg=true)](https://ci.appveyor.com/project/konsolebox/digest-xxhash-ruby)
95
+ [![Build Status](https://github.com/konsolebox/digest-xxhash-ruby/actions/workflows/ruby.yml/badge.svg)](https://github.com/konsolebox/digest-xxhash-ruby/actions/workflows/ruby.yml)
96
+ [![Build Status](https://ci.appveyor.com/api/projects/status/kb6hvlxjms3ftw7u?svg=true)](https://ci.appveyor.com/project/konsolebox/digest-xxhash-ruby)
data/Rakefile CHANGED
@@ -1,10 +1,21 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rake/extensiontask'
2
3
  require 'rake/testtask'
3
4
 
4
5
  # clean, clobber, compile, and compile:digest/xxhash
5
- require 'rake/extensiontask'
6
6
  Rake::ExtensionTask.new('digest/xxhash', Bundler::GemHelper.gemspec)
7
7
 
8
+ # install
9
+ Rake::Task[:install].clear
10
+ task :install => :build do
11
+ name = Bundler::GemHelper.gemspec.name
12
+ pkg_dir = File.join(Bundler::GemHelper.instance.base, "pkg")
13
+ built_gem = Dir.chdir(pkg_dir){ Dir.glob("#{name}-*.gem").sort_by{ |f| File.mtime(f) }.last }
14
+ gem_command = (ENV["GEM_COMMAND"].shellsplit rescue nil) || ["gem"]
15
+ options = ARGV.select{ |e| e =~ /\A--?/ }
16
+ Process.wait spawn(*gem_command, "install", File.join(pkg_dir, built_gem), *options)
17
+ end
18
+
8
19
  # test
9
20
  Rake::TestTask.new(:test => :compile) do |t|
10
21
  t.test_files = FileList['test/test.rb']
@@ -17,7 +28,7 @@ task :clean do
17
28
  rm_f list unless list.empty?
18
29
  end
19
30
 
20
- # Set 'test' as default task.
31
+ # default
21
32
  task :default => :test
22
33
 
23
34
  # Run `rake --tasks` for a list of tasks.
@@ -9,20 +9,24 @@ Gem::Specification.new do |spec|
9
9
  spec.version = Digest::XXHash::VERSION
10
10
  spec.authors = ["konsolebox"]
11
11
  spec.email = ["konsolebox@gmail.com"]
12
- spec.summary = "XXHash for Ruby"
13
- spec.description = "An XXHash library that complies with Digest::Instance's functional design."
12
+ spec.summary = "A Digest framework based XXHash library for Ruby"
13
+ spec.description = <<-EOF
14
+ This gem provides XXH32, XXH64, XXH3_64bits and XXH3_128bits
15
+ functionalities for Ruby. It inherits Digest::Class and complies
16
+ with Digest::Instance's functional design.
17
+ EOF
14
18
  spec.homepage = "https://github.com/konsolebox/digest-xxhash-ruby"
15
19
  spec.license = "MIT"
16
20
 
17
21
  spec.required_ruby_version = '>= 2.2'
18
22
 
19
- spec.files = `git ls-files -z`.split("\x0")
20
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
+ spec.files = `git ls-files -z`.split("\x0").reject{ |f| f =~ /\.yml$/ }
24
+ spec.executables = spec.files.grep(%r{^bin/}){ |f| File.basename(f) }
21
25
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
26
  spec.require_paths = ["lib"]
23
27
 
24
28
  spec.add_development_dependency "rake"
25
- spec.add_development_dependency "rake-compiler", "~> 1.0"
29
+ spec.add_development_dependency "rake-compiler", "~> 1.0", "!= 1.1.3", "!= 1.1.4", "!= 1.1.5"
26
30
  spec.add_development_dependency "minitest", "~> 5.8"
27
31
 
28
32
  spec.extensions = %w[ext/digest/xxhash/extconf.rb]