xxhash 0.2.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ruby.yml +38 -0
- data/.gitignore +2 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile +1 -1
- data/README.md +14 -4
- data/Rakefile +1 -0
- data/ext/xxhash/extconf.rb +2 -3
- data/ext/xxhash/libxxhash.c +683 -268
- data/ext/xxhash/libxxhash.h +208 -71
- data/ext/xxhash/xxhash.c +224 -0
- data/ext/xxhash/xxhash.h +34 -0
- data/lib/xxhash/version.rb +1 -1
- data/lib/xxhash.rb +90 -6
- data/test/xxhash_test.rb +139 -4
- data/xxhash.gemspec +2 -1
- metadata +13 -20
- data/.travis.yml +0 -4
- data/ext/xxhash/xxhash.cc +0 -56
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b9e0c970d797503c0fd848023fbf5c4ac64d17744417e990d7d638cbe4447fd2
|
4
|
+
data.tar.gz: 41814924ceba3ab4647fc24e22cec307ea03c4f4076f0f91af7872b60f3807f7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2512c453f3ca7d14e70d2b64ac54daa76efaf36bb8da9a713462aea1f404cbb20953adbd59d4c96375ea08ddf2edd93cdcb9280ffc02cd5a06ff6a47365a8867
|
7
|
+
data.tar.gz: 143dda9ce66c0f980d78d79550f0fd4cebe9b64fd48533f6ea3af2d78300fb063cf8430013dd5f53f4a6379323d40966556642df08a74cb6cd95fa037c1f3a2e
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ "master" ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ "master" ]
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: read
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
test:
|
21
|
+
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
strategy:
|
24
|
+
matrix:
|
25
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v3
|
29
|
+
- name: Set up Ruby
|
30
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
31
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
32
|
+
# uses: ruby/setup-ruby@v1
|
33
|
+
uses: ruby/setup-ruby@2b019609e2b0f1ea1a2bc8ca11cb82ab46ada124
|
34
|
+
with:
|
35
|
+
ruby-version: ${{ matrix.ruby-version }}
|
36
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
37
|
+
- name: Run tests
|
38
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
### 0.5.0 (July 28, 2022)
|
2
|
+
* Mark extension as Ractor-safe (by [@kreynolds](https://github.com/kreynolds))
|
3
|
+
* Add ability to hash files by path directly with `XXhash.xxh32_file` and `XXhash.xxh64_file` (by [@kreynolds](https://github.com/kreynolds))
|
4
|
+
|
5
|
+
### 0.4.0 (December 11, 2016)
|
6
|
+
* Add xxHash to `Digest` module and make it more compatieble
|
7
|
+
with another hash functions from `Digest`. (by [@justinwsmith](https://github.com/justinwsmith))
|
8
|
+
* Add a `StreamingHash` class that's externally instantiatable. (by [@justinwsmith](https://github.com/justinwsmith))
|
9
|
+
* Fix segfault when nil is passed as param (https://github.com/nashby/xxhash/issues/13) (by [@justinwsmith](https://github.com/justinwsmith))
|
10
|
+
* Update libxxhash to 0.6.2.
|
11
|
+
|
12
|
+
### 0.3.0 (January 18, 2015)
|
13
|
+
* make seed param optional (by [@weakish](https://github.com/weakish))
|
14
|
+
* add 64-bit xxhash function (by [@justinwsmith](https://github.com/justinwsmith))
|
15
|
+
|
1
16
|
### 0.2.0 (September 4, 2013)
|
2
17
|
* xxHash updated to [r32](https://code.google.com/p/xxhash/source/detail?r=32)
|
3
18
|
* add `XXhash.xxh32_stream` method (by [@maltoe](https://github.com/maltoe))
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## xxHash [![Build Status](https://travis-ci.org/nashby/xxhash.png?branch=master)](https://travis-ci.org/nashby/xxhash)
|
2
2
|
|
3
|
-
Ruby wrapper for [xxHash](
|
3
|
+
Ruby wrapper for [xxHash](https://github.com/Cyan4973/xxHash)
|
4
4
|
|
5
5
|
### Install
|
6
6
|
|
@@ -17,24 +17,34 @@ seed = 12345
|
|
17
17
|
XXhash.xxh32(text, seed) # => 3834992036
|
18
18
|
```
|
19
19
|
|
20
|
+
If you do not provide a seed, it will use the default value `0`.
|
21
|
+
|
20
22
|
You can use it with `IO` objects too:
|
21
23
|
|
22
24
|
```ruby
|
23
25
|
XXhash.xxh32_stream(StringIO.new('test'), 123) # => 2758658570
|
24
26
|
```
|
25
27
|
|
28
|
+
You can use it with file path directly, avoiding costly ruby-related operations.
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
XXhash.xxh32_file(__FILE__)
|
32
|
+
```
|
33
|
+
|
26
34
|
Note that you can also pass a chunk size as third param (it's 32 bytes by default)
|
27
35
|
|
36
|
+
XXH64 is also supported: you can use `xxh64`, `xxh64_stream`, `.xxh64_file`.
|
37
|
+
|
28
38
|
### Supported Ruby versions
|
29
39
|
|
30
|
-
- MRI
|
40
|
+
- MRI 2.3+
|
31
41
|
- rbx-19mode
|
32
42
|
|
33
43
|
Note: It doesn't work on JRuby as it uses C extension.
|
34
44
|
|
35
45
|
### Versioning
|
36
46
|
|
37
|
-
Version 0.
|
47
|
+
Version 0.5.0 is equal to [0.6.2](https://github.com/Cyan4973/xxHash/tree/v0.6.2)
|
38
48
|
|
39
49
|
## Contributing
|
40
50
|
|
@@ -46,5 +56,5 @@ Version 0.2.0 is equal to [r32](https://code.google.com/p/xxhash/source/detail?r
|
|
46
56
|
|
47
57
|
### Copyright
|
48
58
|
|
49
|
-
Copyright (c)
|
59
|
+
Copyright (c) 2022 Vasiliy Ermolovich. See LICENSE.txt for
|
50
60
|
further details.
|
data/Rakefile
CHANGED
data/ext/xxhash/extconf.rb
CHANGED