digest-xxhash 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +6 -0
- data/README.md +3 -0
- data/Rakefile +3 -0
- data/appveyor.yml +19 -0
- data/ext/digest/xxhash/ext.c +11 -8
- data/lib/digest/xxhash/version.rb +4 -2
- data/test/test.rb +2 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 155293f54dc37486a7827e7356f3758f0cd411e444a66be7e35058e7f6ed742e
|
4
|
+
data.tar.gz: 5c304167f2978dec00ed022c985360af16bcd91581f35a280a2c42aa7a4f5555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 510fd4a123c89d68eeb45a263f120dd85e88aa2dca4ca747f4231195dbb1687d77b997a50d3675a2627607f55b22a4134a231c73a7fbf312cef8e6a8676cf846
|
7
|
+
data.tar.gz: 22dd84864a3bace71d39cd0886d13d74d867b680b6b28fc72d684ff98c169632e1de22758b1063c1514d795caacd019edf6281b480bf78175d8d7ecf7201b099
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -59,3 +59,6 @@ Or install it yourself as:
|
|
59
59
|
3. Commit your changes (`git commit -am 'Add some feature'`).
|
60
60
|
4. Push to the branch (`git push origin my-new-feature`).
|
61
61
|
5. Create a new Pull Request.
|
62
|
+
|
63
|
+
[](https://travis-ci.org/konsolebox/digest-xxhash-ruby)
|
64
|
+
[](https://ci.appveyor.com/project/konsolebox/digest-xxhash-ruby)
|
data/Rakefile
CHANGED
data/appveyor.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
version: 1.0.{build}
|
2
|
+
init:
|
3
|
+
- cmd: >-
|
4
|
+
set base_path=C:/Program Files/7-Zip;C:/Program Files/AppVeyor/BuildAgent;C:/Program Files/Git/cmd;C:/Windows/system32;C:/Windows;"C:/Program Files (x86)/GNU/GnuPG/pub"
|
5
|
+
|
6
|
+
set PATH=C:/ruby%ruby_version%/bin;C:/msys64/usr/bin;%base_path%
|
7
|
+
environment:
|
8
|
+
matrix:
|
9
|
+
- ruby_version: 22-x64
|
10
|
+
- ruby_version: 23-x64
|
11
|
+
- ruby_version: 24-x64
|
12
|
+
- ruby_version: 25-x64
|
13
|
+
install:
|
14
|
+
- cmd: bundle install
|
15
|
+
build_script:
|
16
|
+
- cmd: bundle exec rake -rdevkit compile
|
17
|
+
test_script:
|
18
|
+
- cmd: bundle exec rake test
|
19
|
+
deploy: off
|
data/ext/digest/xxhash/ext.c
CHANGED
@@ -23,7 +23,6 @@
|
|
23
23
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
*/
|
25
25
|
|
26
|
-
|
27
26
|
#include <ruby.h>
|
28
27
|
#include <ruby/digest.h>
|
29
28
|
#include <stdint.h>
|
@@ -63,6 +62,7 @@ static ID _id_reset;
|
|
63
62
|
static ID _id_update;
|
64
63
|
|
65
64
|
static VALUE _Digest;
|
65
|
+
static VALUE _Digest_Class;
|
66
66
|
static VALUE _Digest_XXHash;
|
67
67
|
static VALUE _Digest_XXH32;
|
68
68
|
static VALUE _Digest_XXH64;
|
@@ -409,7 +409,7 @@ static VALUE _Digest_XXH32_internal_allocate(VALUE klass)
|
|
409
409
|
static VALUE _Digest_XXH32_update(VALUE self, VALUE str)
|
410
410
|
{
|
411
411
|
if (XXH32_update(_get_state_32(self), RSTRING_PTR(str), RSTRING_LEN(str)) != XXH_OK)
|
412
|
-
rb_raise(rb_eRuntimeError, "Failed to
|
412
|
+
rb_raise(rb_eRuntimeError, "Failed to update state.");
|
413
413
|
|
414
414
|
return self;
|
415
415
|
}
|
@@ -557,7 +557,7 @@ static VALUE _Digest_XXH64_internal_allocate(VALUE klass)
|
|
557
557
|
static VALUE _Digest_XXH64_update(VALUE self, VALUE str)
|
558
558
|
{
|
559
559
|
if (XXH64_update(_get_state_64(self), RSTRING_PTR(str), RSTRING_LEN(str)) != XXH_OK)
|
560
|
-
rb_raise(rb_eRuntimeError, "Failed to
|
560
|
+
rb_raise(rb_eRuntimeError, "Failed to update state.");
|
561
561
|
|
562
562
|
return self;
|
563
563
|
}
|
@@ -700,18 +700,21 @@ void Init_xxhash()
|
|
700
700
|
DEFINE_ID(reset)
|
701
701
|
DEFINE_ID(update)
|
702
702
|
|
703
|
-
#if 0
|
704
|
-
_Digest = rb_define_module("Digest"); /* Tell RDoc about Digest since it doesn't recognize rb_path2class. */
|
705
|
-
#endif
|
706
|
-
|
707
703
|
rb_require("digest");
|
708
704
|
_Digest = rb_path2class("Digest");
|
705
|
+
_Digest_Class = rb_path2class("Digest::Class");
|
706
|
+
|
707
|
+
#if 0
|
708
|
+
/* Tell RDoc about Digest and Digest::Class since it doesn't parse rb_path2class. */
|
709
|
+
_Digest = rb_define_module("Digest");
|
710
|
+
_Digest_Class = rb_define_class_under(_Digest, "Class", rb_cObject);
|
711
|
+
#endif
|
709
712
|
|
710
713
|
/*
|
711
714
|
* Document-class: Digest::XXHash
|
712
715
|
*/
|
713
716
|
|
714
|
-
_Digest_XXHash = rb_define_class_under(_Digest, "XXHash",
|
717
|
+
_Digest_XXHash = rb_define_class_under(_Digest, "XXHash", _Digest_Class);
|
715
718
|
|
716
719
|
rb_define_method(_Digest_XXHash, "digest", _Digest_XXHash_digest, -1);
|
717
720
|
rb_define_method(_Digest_XXHash, "hexdigest", _Digest_XXHash_hexdigest, -1);
|
data/test/test.rb
CHANGED
@@ -22,10 +22,10 @@ end
|
|
22
22
|
it "produces correct types of digest outputs" do
|
23
23
|
klass.digest("").must_be_instance_of String
|
24
24
|
klass.hexdigest("").must_be_instance_of String
|
25
|
-
klass.idigest("").
|
25
|
+
klass.idigest("").must_be_kind_of Integer
|
26
26
|
klass.new.digest("").must_be_instance_of String
|
27
27
|
klass.new.hexdigest("").must_be_instance_of String
|
28
|
-
klass.new.idigest("").
|
28
|
+
klass.new.idigest("").must_be_kind_of Integer
|
29
29
|
end
|
30
30
|
|
31
31
|
it "produces similar output with its digest, hexdigest and idigest methods" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digest-xxhash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- konsolebox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -60,10 +60,12 @@ extensions:
|
|
60
60
|
- ext/digest/xxhash/extconf.rb
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
+
- ".travis.yml"
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE
|
65
66
|
- README.md
|
66
67
|
- Rakefile
|
68
|
+
- appveyor.yml
|
67
69
|
- digest-xxhash.gemspec
|
68
70
|
- ext/digest/xxhash/debug-funcs.h
|
69
71
|
- ext/digest/xxhash/ext.c
|
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
97
|
version: '0'
|
96
98
|
requirements: []
|
97
99
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.7.4
|
99
101
|
signing_key:
|
100
102
|
specification_version: 4
|
101
103
|
summary: XXHash for Ruby
|