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 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
@@ -1,6 +1,7 @@
1
1
  *.gem
2
2
  *.rbc
3
3
  *.bundle
4
+ **/*.iml
4
5
  .config
5
6
  .yardoc
6
7
  Gemfile.lock
@@ -16,3 +17,4 @@ test/tmp
16
17
  test/version_tmp
17
18
  tmp
18
19
  lib/xxhash/xxhash.so
20
+ .idea/
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
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
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](http://code.google.com/p/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 1.9.3
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.2.0 is equal to [r32](https://code.google.com/p/xxhash/source/detail?r32)
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) 2013 Vasiliy Ermolovich. See LICENSE.txt for
59
+ Copyright (c) 2022 Vasiliy Ermolovich. See LICENSE.txt for
50
60
  further details.
data/Rakefile CHANGED
@@ -14,6 +14,7 @@ task :default => :test
14
14
 
15
15
  require 'rake/extensiontask'
16
16
  Rake::ExtensionTask.new('xxhash') do |ext|
17
+ # Customizations can be set here
17
18
  ext.lib_dir = 'lib/xxhash'
18
19
  end
19
20
 
@@ -1,8 +1,7 @@
1
1
  require 'mkmf'
2
2
 
3
- %w{g O3 Wall}.each do |flag|
4
- flag = "-#{flag}"
5
- $CPPFLAGS += " #{flag}" unless $CPPFLAGS.split.include? flag
3
+ %w{ g O3 Wno-padded }.each do |flag|
4
+ $CFLAGS += " -#{flag}"
6
5
  end
7
6
 
8
7
  create_makefile('xxhash/xxhash')