diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 37b02bb..d97068d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index 29f0c0d..1e65a7e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 Style/StringLiterals: Enabled: true diff --git a/Cargo.lock b/Cargo.lock index 128b589..c109bac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -25,9 +25,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags", "cexpr", @@ -45,15 +45,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "blake3" -version = "1.5.4" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +checksum = "389a099b34312839e16420d499a9cad9650541715937ffbdd40d36f49e77eeb3" dependencies = [ "arrayref", "arrayvec", @@ -64,7 +64,7 @@ dependencies = [ [[package]] name = "blake3ruby" -version = "0.2.4" +version = "0.3.0" dependencies = [ "blake3", "hex", @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362" dependencies = [ "shlex", ] @@ -114,15 +114,15 @@ checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "hex" @@ -153,15 +153,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", @@ -214,36 +214,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "rb-sys" -version = "0.9.102" +version = "0.9.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df4dec4b1d304c3b308a2cd86b1216ea45dd4361f4e9fa056f108332d0a450c1" +checksum = "becea799ce051c16fb140be80f5e7cf781070f99ca099332383c2b17861249af" dependencies = [ "rb-sys-build", ] [[package]] name = "rb-sys-build" -version = "0.9.102" +version = "0.9.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d71de3e29d174b8fb17b5d4470f27d7aa2605f8a9d05fda0d3aeff30e05a570" +checksum = "64691175abc704862f60a9ca8ef06174080cc50615f2bf1d4759f46db18b4d29" dependencies = [ "bindgen", "lazy_static", @@ -262,9 +262,9 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb" [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -274,9 +274,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -297,9 +297,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "seq-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" +checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" [[package]] name = "shell-words" @@ -315,9 +315,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "syn" -version = "2.0.79" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -326,9 +326,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "windows-targets" diff --git a/Gemfile.lock b/Gemfile.lock index ae6cdeb..84bad25 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,31 +1,35 @@ 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) @@ -33,25 +37,31 @@ GEM 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 @@ -74,4 +84,4 @@ DEPENDENCIES rubocop-rspec BUNDLED WITH - 2.5.20 + 2.6.7 diff --git a/README.md b/README.md index b209b8b..e7c664b 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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) @@ -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. diff --git a/blake3ruby.gemspec b/blake3ruby.gemspec index 2cb3cca..e2e7fe9 100644 --- a/blake3ruby.gemspec +++ b/blake3ruby.gemspec @@ -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] diff --git a/ext/blake3ruby/Cargo.toml b/ext/blake3ruby/Cargo.toml index 9765248..a59ffe1 100644 --- a/ext/blake3ruby/Cargo.toml +++ b/ext/blake3ruby/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blake3ruby" -version = "0.2.4" +version = "0.3.0" edition = "2021" authors = ["Nightforge "] publish = false @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] magnus = { version = "0.7.1" } hex = { version = "0.4.3" } -blake3 = { version = "1.5.1" } +blake3 = { version = "1.7" } [package.metadata.magnus] rbconfig = true diff --git a/lib/blake3ruby/version.rb b/lib/blake3ruby/version.rb index f5b3a9c..a528b40 100644 --- a/lib/blake3ruby/version.rb +++ b/lib/blake3ruby/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Blake3ruby - VERSION = "0.2.4" + VERSION = "0.3.0" end