Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
strategy:
matrix:
ruby:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- "3.1"
- "3.2"
- "3.3"
- "3.4"

steps:
- uses: actions/checkout@v3
- name: Set up Ruby & Rust
uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cargo-cache: true
rubygems: '3.4.7'
- name: Run the default task
run: bundle exec rake
- uses: actions/checkout@v3
- name: Set up Ruby & Rust
uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cargo-cache: true
rubygems: "3.6.2"
- name: Run the default task
run: bundle exec rake
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1

Style/StringLiterals:
Enabled: true
Expand Down
72 changes: 36 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 34 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,57 +1,67 @@
PATH
remote: .
specs:
blake3ruby (0.2.4)
blake3ruby (0.3.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
diff-lcs (1.5.1)
json (2.7.2)
language_server-protocol (3.17.0.3)
ast (2.4.3)
diff-lcs (1.6.1)
json (2.10.2)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.7.4)
ast (~> 2.4.1)
racc
prism (1.4.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rake-compiler (1.2.8)
rake-compiler (1.3.0)
rake
rb_sys (0.9.102)
regexp_parser (2.9.2)
rake-compiler-dock (1.9.1)
rb_sys (0.9.111)
rake-compiler-dock (= 1.9.1)
regexp_parser (2.10.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.1)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.66.1)
rspec-support (3.13.2)
rubocop (1.75.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (3.1.0)
rubocop (~> 1.61)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.44.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-rake (0.7.1)
lint_roller (~> 1.1)
rubocop (>= 1.72.1)
rubocop-rspec (3.5.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
ruby-progressbar (1.13.0)
unicode-display_width (2.6.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)

PLATFORMS
aarch64-linux
Expand All @@ -74,4 +84,4 @@ DEPENDENCIES
rubocop-rspec

BUNDLED WITH
2.5.20
2.6.7
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This is a Ruby wrapper for the [BLAKE3](https://github.com/BLAKE3-team/BLAKE3) hash function written in Rust.

## Requirements
Tested on Ruby 3.1, 3.2 and 3.3.
Tested on Ruby 3.1, 3.2, 3.3 and 3.4.
You will need to have Rust installed on your system, and the `cargo` command available in your path.
See [here](https://www.rust-lang.org/tools/install) for instructions on how to install Rust.
Rust is only required to build the gem, not to use it.
Expand Down Expand Up @@ -72,7 +72,7 @@ In versions 0.1.0 and 0.1.1, the Blake3ruby namespace was available. Starting fr
The performance of this gem is comparable to the performance of the [blake3](https://github.com/BLAKE3-team/BLAKE3)
crate, which is written in Rust.

The following benchmark was run on a 2015 MacBook Pro with a 2.5 GHz 4-Core Intel Core i7 processor and 16 GB of RAM.
The following benchmark was run on a 2015 MacBook Pro with a 2.5 GHz 4-Core Intel Core i7 processor and 16 GB of RAM.
```
MD5 (13 chars): 6.141045 0.086745 6.227790 ( 6.263524)
SHA1 (13 chars): 6.230957 0.080145 6.311102 ( 6.333384)
Expand Down Expand Up @@ -123,16 +123,16 @@ Fastest: blake3 with 8.499842999968678 seconds
Slowest: RMD160 with 24.535302000120282 seconds
```

Another benchmark was run on a 2022 MacBook Pro with a Apple M1 processor and 16 GB of RAM.
Another benchmark was run on a 2022 MacBook Pro with a Apple M1 processor and 16 GB of RAM.
```
user system total real
MD5: 4.080778 0.029457 4.110235 ( 4.388991)
SHA1: 3.736124 0.030763 3.766887 ( 3.991860)
SHA3-256: 3.511138 0.036125 3.547263 ( 3.664061)
SHA3-384: 4.009041 0.085845 4.094886 ( 4.094987)
SHA3-512: 4.078389 0.071463 4.149852 ( 4.149982)
RMD160: 2.965860 0.026660 2.992520 ( 3.216815)
blake3: 1.715370 0.004587 1.719957 ( 1.719995)
user system total real
MD5 (13 chars): 4.055481 0.041212 4.096693 ( 4.097044)
SHA1 (13 chars): 3.862285 0.050686 3.912971 ( 3.928102)
SHA3-256 (13 chars): 2.293100 0.052982 2.346082 ( 2.346571)
SHA3-384 (13 chars): 2.767608 0.079975 2.847583 ( 2.847594)
SHA3-512 (13 chars): 2.792520 0.070482 2.863002 ( 2.862991)
RMD160 (13 chars): 2.842812 0.036370 2.879182 ( 3.097712)
blake3 (13 chars): 1.208742 0.004124 1.212866 ( 1.212986)
```

In both cases, the `blake3ruby` gem was about 2.5 times faster than the md5, sha1, sha3-256, sha3-384, sha3-512, and rmd160 digest algorithms.
Expand Down
2 changes: 1 addition & 1 deletion blake3ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.summary = "Ruby bindings for the blake3 hash function"
spec.description = "Ruby bindings for the blake3 hash function using the Rust implementation"
spec.homepage = "https://github.com/Nightforge/blake3ruby"
spec.required_ruby_version = ">= 3.0"
spec.required_ruby_version = ">= 3.1"
spec.required_rubygems_version = ">= 3.3.11"
spec.licenses = %w[MIT Ruby]

Expand Down
Loading
Loading