digest-blake3 1.5.1.0 → 1.5.2.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/ext/digest/blake3/blake3_ruby.c +16 -0
- data/ext/digest/blake3/extconf.rb +16 -0
- data/lib/digest/blake3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1be5125a020dcddb9fb6a17404faa25416b64ada7cc9f3583ad7fb2c87e5d786
|
|
4
|
+
data.tar.gz: da4f177d0d43219a32eeed394c8486c841197f505bdd89f3e5e3ddcf8fc21ab0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49f2c23d359bf51ddf82bbf6894cc2fa665029dbc1ebc632e001209e75959a41ca6cfb92243f4da36e1dcbbc657a7fba4480c8eef585808a75c94ecfd253767d
|
|
7
|
+
data.tar.gz: bb3ee33e6717d8adc4e3deeadb40a8c5607a8214a4f89207a2ee44ff2ce107ec24dcd53583219de803e305f504d1e6d52c935593b3e165fa4816bab6cf1f29fb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -60,6 +60,11 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
60
60
|
|
|
61
61
|
Bug reports and pull requests are welcome on GitHub at https://github.com/willbryant/digest-blake3.
|
|
62
62
|
|
|
63
|
+
## Thanks
|
|
64
|
+
|
|
65
|
+
* Scott Phillips (@fundthmcalculus)
|
|
66
|
+
* Facundo Farias (@facundofarias)
|
|
67
|
+
|
|
63
68
|
## License
|
|
64
69
|
|
|
65
70
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -31,8 +31,24 @@ void Init_blake3(void) {
|
|
|
31
31
|
cDigest_Base = rb_path2class("Digest::Base");
|
|
32
32
|
cDigest_BLAKE3 = rb_define_class_under(mDigest, "BLAKE3", cDigest_Base);
|
|
33
33
|
|
|
34
|
+
/* Register the metadata.
|
|
35
|
+
*
|
|
36
|
+
* Ruby 3.4's digest framework (digest 3.2+) validates that the "metadata"
|
|
37
|
+
* ivar is a TypedData object and raises
|
|
38
|
+
* TypeError: Digest::BLAKE3::metadata is not initialized properly
|
|
39
|
+
* from Digest::Base#initialize when it is not. The legacy untyped
|
|
40
|
+
* Data_Wrap_Struct fails that check.
|
|
41
|
+
*
|
|
42
|
+
* rb_digest_make_metadata is the supported API but is absent from older
|
|
43
|
+
* ruby/digest.h, so extconf.rb feature-detects it and the old path is kept
|
|
44
|
+
* for Rubies that predate it. */
|
|
45
|
+
#ifdef HAVE_RB_DIGEST_MAKE_METADATA
|
|
46
|
+
rb_iv_set(cDigest_BLAKE3, "metadata",
|
|
47
|
+
rb_digest_make_metadata(&blake3));
|
|
48
|
+
#else
|
|
34
49
|
#undef RUBY_UNTYPED_DATA_WARNING
|
|
35
50
|
#define RUBY_UNTYPED_DATA_WARNING 0
|
|
36
51
|
rb_iv_set(cDigest_BLAKE3, "metadata",
|
|
37
52
|
Data_Wrap_Struct(0, 0, 0, (void *)&blake3));
|
|
53
|
+
#endif
|
|
38
54
|
}
|
|
@@ -8,6 +8,22 @@ CONFIG["optflags"] = "-O3"
|
|
|
8
8
|
$warnflags.sub!("-Wdeclaration-after-statement", "") # eg. RVM compiles Ruby with this set on some platforms, so it ends up in RbConfig::MAKEFILE_CONFIG
|
|
9
9
|
append_cflags("-std=c99")
|
|
10
10
|
|
|
11
|
+
# Ruby 3.4's digest framework (digest 3.2+) validates that the "metadata" ivar is
|
|
12
|
+
# a TypedData object; the legacy untyped Data_Wrap_Struct fails that check with
|
|
13
|
+
# "TypeError: Digest::BLAKE3::metadata is not initialized properly".
|
|
14
|
+
# rb_digest_make_metadata is the supported replacement, but it does not exist in
|
|
15
|
+
# older ruby/digest.h (Ruby 2.7 reports RUBY_DIGEST_API_VERSION 3 without
|
|
16
|
+
# providing it), so it has to be feature-detected rather than version-gated.
|
|
17
|
+
#
|
|
18
|
+
# have_func links rather than only compiling. That matters: a compile-only probe
|
|
19
|
+
# relies on an implicit function declaration being an error, which is true for
|
|
20
|
+
# clang >= 16 and gcc >= 14 but only a WARNING on gcc 7 -- the compiler on our
|
|
21
|
+
# Ubuntu 18.04 hosts. There the probe would false-positive, the fallback would be
|
|
22
|
+
# skipped, and the extension would build with an unresolved symbol that only
|
|
23
|
+
# fails at require time. The probe deliberately runs after the flag setup above
|
|
24
|
+
# so it is tested under the same flags as the real build.
|
|
25
|
+
have_func("rb_digest_make_metadata", "ruby/digest.h")
|
|
26
|
+
|
|
11
27
|
# we can't let create_makefile default to compiling all source files in the directory, because then
|
|
12
28
|
# it won't set the appropriate flags for the different versions. start by explicitly resetting the
|
|
13
29
|
# list to the files that we always want. blake3_ruby.o is the only one we've implemented ourselves
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: digest-blake3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Will Bryant
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-09-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|