blake3ruby 0.1.0 → 0.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/.rubocop.yml +5 -0
- data/Cargo.lock +131 -119
- data/Gemfile +10 -5
- data/Gemfile.lock +48 -29
- data/README.md +56 -15
- data/Rakefile +1 -0
- data/blake3ruby.gemspec +34 -0
- data/ext/blake3ruby/Cargo.toml +6 -3
- data/ext/blake3ruby/src/lib.rs +11 -10
- data/lib/blake3ruby/version.rb +1 -1
- data/sig/blake3ruby.rbs +13 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 446ad17adfad2f4096491ae74ff7f4a986f7bf4e1534248408435862ae2b5037
|
4
|
+
data.tar.gz: 85878e5c2e3e09bfc4b0412c05f62a428cd40b7c0f31906293dfede7ce7408d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96a54200ac5a1c584e73960130818c1428b698349053bf3f7c8ca5368fe54b29b824177d5d48cfa52177b9c0dd8ae7976ea78d5ff0e2f3d6e2f03c16e0f7f98d
|
7
|
+
data.tar.gz: 29a7a9a19dd9edc7083a57ac79a9f66b0b454f2414a5f26b7897bf4773615b68fe5d50d7cedd200b6eaa5bba987be5ab4f2d9d4067ab4c3c9cff0e51860c23a2
|
data/.rubocop.yml
CHANGED
data/Cargo.lock
CHANGED
@@ -4,9 +4,9 @@ version = 3
|
|
4
4
|
|
5
5
|
[[package]]
|
6
6
|
name = "aho-corasick"
|
7
|
-
version = "
|
7
|
+
version = "1.1.3"
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
9
|
-
checksum = "
|
9
|
+
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
|
10
10
|
dependencies = [
|
11
11
|
"memchr",
|
12
12
|
]
|
@@ -19,72 +19,63 @@ checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
|
|
19
19
|
|
20
20
|
[[package]]
|
21
21
|
name = "arrayvec"
|
22
|
-
version = "0.7.
|
22
|
+
version = "0.7.4"
|
23
23
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
24
|
-
checksum = "
|
24
|
+
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
|
25
25
|
|
26
26
|
[[package]]
|
27
27
|
name = "bindgen"
|
28
|
-
version = "0.
|
28
|
+
version = "0.69.4"
|
29
29
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
30
|
-
checksum = "
|
30
|
+
checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
|
31
31
|
dependencies = [
|
32
32
|
"bitflags",
|
33
33
|
"cexpr",
|
34
34
|
"clang-sys",
|
35
|
+
"itertools",
|
35
36
|
"lazy_static",
|
36
37
|
"lazycell",
|
37
|
-
"peeking_take_while",
|
38
38
|
"proc-macro2",
|
39
39
|
"quote",
|
40
40
|
"regex",
|
41
41
|
"rustc-hash",
|
42
42
|
"shlex",
|
43
|
+
"syn",
|
43
44
|
]
|
44
45
|
|
45
46
|
[[package]]
|
46
47
|
name = "bitflags"
|
47
|
-
version = "
|
48
|
+
version = "2.6.0"
|
48
49
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
49
|
-
checksum = "
|
50
|
+
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
50
51
|
|
51
52
|
[[package]]
|
52
53
|
name = "blake3"
|
53
|
-
version = "1.
|
54
|
+
version = "1.5.1"
|
54
55
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
55
|
-
checksum = "
|
56
|
+
checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52"
|
56
57
|
dependencies = [
|
57
58
|
"arrayref",
|
58
59
|
"arrayvec",
|
59
60
|
"cc",
|
60
61
|
"cfg-if",
|
61
62
|
"constant_time_eq",
|
62
|
-
"digest",
|
63
63
|
]
|
64
64
|
|
65
65
|
[[package]]
|
66
66
|
name = "blake3ruby"
|
67
|
-
version = "0.
|
67
|
+
version = "0.2.0"
|
68
68
|
dependencies = [
|
69
69
|
"blake3",
|
70
70
|
"hex",
|
71
71
|
"magnus",
|
72
72
|
]
|
73
73
|
|
74
|
-
[[package]]
|
75
|
-
name = "block-buffer"
|
76
|
-
version = "0.10.4"
|
77
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
78
|
-
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
79
|
-
dependencies = [
|
80
|
-
"generic-array",
|
81
|
-
]
|
82
|
-
|
83
74
|
[[package]]
|
84
75
|
name = "cc"
|
85
|
-
version = "1.0.
|
76
|
+
version = "1.0.104"
|
86
77
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
87
|
-
checksum = "
|
78
|
+
checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490"
|
88
79
|
|
89
80
|
[[package]]
|
90
81
|
name = "cexpr"
|
@@ -103,9 +94,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
103
94
|
|
104
95
|
[[package]]
|
105
96
|
name = "clang-sys"
|
106
|
-
version = "1.
|
97
|
+
version = "1.8.1"
|
107
98
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
108
|
-
checksum = "
|
99
|
+
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
|
109
100
|
dependencies = [
|
110
101
|
"glob",
|
111
102
|
"libc",
|
@@ -114,40 +105,15 @@ dependencies = [
|
|
114
105
|
|
115
106
|
[[package]]
|
116
107
|
name = "constant_time_eq"
|
117
|
-
version = "0.
|
118
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
119
|
-
checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b"
|
120
|
-
|
121
|
-
[[package]]
|
122
|
-
name = "crypto-common"
|
123
|
-
version = "0.1.6"
|
124
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
125
|
-
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
126
|
-
dependencies = [
|
127
|
-
"generic-array",
|
128
|
-
"typenum",
|
129
|
-
]
|
130
|
-
|
131
|
-
[[package]]
|
132
|
-
name = "digest"
|
133
|
-
version = "0.10.6"
|
108
|
+
version = "0.3.0"
|
134
109
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
135
|
-
checksum = "
|
136
|
-
dependencies = [
|
137
|
-
"block-buffer",
|
138
|
-
"crypto-common",
|
139
|
-
"subtle",
|
140
|
-
]
|
110
|
+
checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2"
|
141
111
|
|
142
112
|
[[package]]
|
143
|
-
name = "
|
144
|
-
version = "
|
113
|
+
name = "either"
|
114
|
+
version = "1.13.0"
|
145
115
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
146
|
-
checksum = "
|
147
|
-
dependencies = [
|
148
|
-
"typenum",
|
149
|
-
"version_check",
|
150
|
-
]
|
116
|
+
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
151
117
|
|
152
118
|
[[package]]
|
153
119
|
name = "glob"
|
@@ -161,11 +127,20 @@ version = "0.4.3"
|
|
161
127
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
162
128
|
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
163
129
|
|
130
|
+
[[package]]
|
131
|
+
name = "itertools"
|
132
|
+
version = "0.12.1"
|
133
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
134
|
+
checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
|
135
|
+
dependencies = [
|
136
|
+
"either",
|
137
|
+
]
|
138
|
+
|
164
139
|
[[package]]
|
165
140
|
name = "lazy_static"
|
166
|
-
version = "1.
|
141
|
+
version = "1.5.0"
|
167
142
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
168
|
-
checksum = "
|
143
|
+
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
169
144
|
|
170
145
|
[[package]]
|
171
146
|
name = "lazycell"
|
@@ -175,36 +150,37 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
|
175
150
|
|
176
151
|
[[package]]
|
177
152
|
name = "libc"
|
178
|
-
version = "0.2.
|
153
|
+
version = "0.2.155"
|
179
154
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
180
|
-
checksum = "
|
155
|
+
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
181
156
|
|
182
157
|
[[package]]
|
183
158
|
name = "libloading"
|
184
|
-
version = "0.
|
159
|
+
version = "0.8.4"
|
185
160
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
186
|
-
checksum = "
|
161
|
+
checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d"
|
187
162
|
dependencies = [
|
188
163
|
"cfg-if",
|
189
|
-
"
|
164
|
+
"windows-targets",
|
190
165
|
]
|
191
166
|
|
192
167
|
[[package]]
|
193
168
|
name = "magnus"
|
194
|
-
version = "0.
|
169
|
+
version = "0.7.1"
|
195
170
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
196
|
-
checksum = "
|
171
|
+
checksum = "3d87ae53030f3a22e83879e666cb94e58a7bdf31706878a0ba48752994146dab"
|
197
172
|
dependencies = [
|
198
173
|
"magnus-macros",
|
199
174
|
"rb-sys",
|
200
175
|
"rb-sys-env",
|
176
|
+
"seq-macro",
|
201
177
|
]
|
202
178
|
|
203
179
|
[[package]]
|
204
180
|
name = "magnus-macros"
|
205
|
-
version = "0.
|
181
|
+
version = "0.6.0"
|
206
182
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
207
|
-
checksum = "
|
183
|
+
checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3"
|
208
184
|
dependencies = [
|
209
185
|
"proc-macro2",
|
210
186
|
"quote",
|
@@ -213,9 +189,9 @@ dependencies = [
|
|
213
189
|
|
214
190
|
[[package]]
|
215
191
|
name = "memchr"
|
216
|
-
version = "2.
|
192
|
+
version = "2.7.4"
|
217
193
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
218
|
-
checksum = "
|
194
|
+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
219
195
|
|
220
196
|
[[package]]
|
221
197
|
name = "minimal-lexical"
|
@@ -233,44 +209,38 @@ dependencies = [
|
|
233
209
|
"minimal-lexical",
|
234
210
|
]
|
235
211
|
|
236
|
-
[[package]]
|
237
|
-
name = "peeking_take_while"
|
238
|
-
version = "0.1.2"
|
239
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
240
|
-
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
241
|
-
|
242
212
|
[[package]]
|
243
213
|
name = "proc-macro2"
|
244
|
-
version = "1.0.
|
214
|
+
version = "1.0.86"
|
245
215
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
246
|
-
checksum = "
|
216
|
+
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
|
247
217
|
dependencies = [
|
248
218
|
"unicode-ident",
|
249
219
|
]
|
250
220
|
|
251
221
|
[[package]]
|
252
222
|
name = "quote"
|
253
|
-
version = "1.0.
|
223
|
+
version = "1.0.36"
|
254
224
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
255
|
-
checksum = "
|
225
|
+
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
256
226
|
dependencies = [
|
257
227
|
"proc-macro2",
|
258
228
|
]
|
259
229
|
|
260
230
|
[[package]]
|
261
231
|
name = "rb-sys"
|
262
|
-
version = "0.9.
|
232
|
+
version = "0.9.97"
|
263
233
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
264
|
-
checksum = "
|
234
|
+
checksum = "47d30bcad206b51f2f66121190ca678dce1fdf3a2eae0ac5d838d1818b19bdf5"
|
265
235
|
dependencies = [
|
266
236
|
"rb-sys-build",
|
267
237
|
]
|
268
238
|
|
269
239
|
[[package]]
|
270
240
|
name = "rb-sys-build"
|
271
|
-
version = "0.9.
|
241
|
+
version = "0.9.97"
|
272
242
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
273
|
-
checksum = "
|
243
|
+
checksum = "3cbd92f281615f3c2dcb9dcb0f0576624752afbf9a7f99173b37c4b55b62dd8a"
|
274
244
|
dependencies = [
|
275
245
|
"bindgen",
|
276
246
|
"lazy_static",
|
@@ -289,9 +259,21 @@ checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
|
|
289
259
|
|
290
260
|
[[package]]
|
291
261
|
name = "regex"
|
292
|
-
version = "1.
|
262
|
+
version = "1.10.5"
|
263
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
264
|
+
checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
|
265
|
+
dependencies = [
|
266
|
+
"aho-corasick",
|
267
|
+
"memchr",
|
268
|
+
"regex-automata",
|
269
|
+
"regex-syntax",
|
270
|
+
]
|
271
|
+
|
272
|
+
[[package]]
|
273
|
+
name = "regex-automata"
|
274
|
+
version = "0.4.7"
|
293
275
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
294
|
-
checksum = "
|
276
|
+
checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
|
295
277
|
dependencies = [
|
296
278
|
"aho-corasick",
|
297
279
|
"memchr",
|
@@ -300,9 +282,9 @@ dependencies = [
|
|
300
282
|
|
301
283
|
[[package]]
|
302
284
|
name = "regex-syntax"
|
303
|
-
version = "0.
|
285
|
+
version = "0.8.4"
|
304
286
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
305
|
-
checksum = "
|
287
|
+
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
|
306
288
|
|
307
289
|
[[package]]
|
308
290
|
name = "rustc-hash"
|
@@ -311,28 +293,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
311
293
|
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
312
294
|
|
313
295
|
[[package]]
|
314
|
-
name = "
|
315
|
-
version = "
|
296
|
+
name = "seq-macro"
|
297
|
+
version = "0.3.5"
|
316
298
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
317
|
-
checksum = "
|
299
|
+
checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4"
|
318
300
|
|
319
301
|
[[package]]
|
320
|
-
name = "
|
302
|
+
name = "shell-words"
|
321
303
|
version = "1.1.0"
|
322
304
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
323
|
-
checksum = "
|
305
|
+
checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
|
324
306
|
|
325
307
|
[[package]]
|
326
|
-
name = "
|
327
|
-
version = "
|
308
|
+
name = "shlex"
|
309
|
+
version = "1.3.0"
|
328
310
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
329
|
-
checksum = "
|
311
|
+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
330
312
|
|
331
313
|
[[package]]
|
332
314
|
name = "syn"
|
333
|
-
version = "
|
315
|
+
version = "2.0.68"
|
334
316
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
335
|
-
checksum = "
|
317
|
+
checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9"
|
336
318
|
dependencies = [
|
337
319
|
"proc-macro2",
|
338
320
|
"quote",
|
@@ -340,41 +322,71 @@ dependencies = [
|
|
340
322
|
]
|
341
323
|
|
342
324
|
[[package]]
|
343
|
-
name = "
|
344
|
-
version = "1.
|
325
|
+
name = "unicode-ident"
|
326
|
+
version = "1.0.12"
|
345
327
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
346
|
-
checksum = "
|
328
|
+
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
347
329
|
|
348
330
|
[[package]]
|
349
|
-
name = "
|
350
|
-
version = "
|
331
|
+
name = "windows-targets"
|
332
|
+
version = "0.52.5"
|
351
333
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
352
|
-
checksum = "
|
334
|
+
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
|
335
|
+
dependencies = [
|
336
|
+
"windows_aarch64_gnullvm",
|
337
|
+
"windows_aarch64_msvc",
|
338
|
+
"windows_i686_gnu",
|
339
|
+
"windows_i686_gnullvm",
|
340
|
+
"windows_i686_msvc",
|
341
|
+
"windows_x86_64_gnu",
|
342
|
+
"windows_x86_64_gnullvm",
|
343
|
+
"windows_x86_64_msvc",
|
344
|
+
]
|
353
345
|
|
354
346
|
[[package]]
|
355
|
-
name = "
|
356
|
-
version = "0.
|
347
|
+
name = "windows_aarch64_gnullvm"
|
348
|
+
version = "0.52.5"
|
357
349
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
358
|
-
checksum = "
|
350
|
+
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
|
359
351
|
|
360
352
|
[[package]]
|
361
|
-
name = "
|
362
|
-
version = "0.
|
353
|
+
name = "windows_aarch64_msvc"
|
354
|
+
version = "0.52.5"
|
363
355
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
364
|
-
checksum = "
|
365
|
-
|
366
|
-
|
367
|
-
"
|
368
|
-
|
356
|
+
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
|
357
|
+
|
358
|
+
[[package]]
|
359
|
+
name = "windows_i686_gnu"
|
360
|
+
version = "0.52.5"
|
361
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
362
|
+
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
|
363
|
+
|
364
|
+
[[package]]
|
365
|
+
name = "windows_i686_gnullvm"
|
366
|
+
version = "0.52.5"
|
367
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
368
|
+
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
|
369
|
+
|
370
|
+
[[package]]
|
371
|
+
name = "windows_i686_msvc"
|
372
|
+
version = "0.52.5"
|
373
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
374
|
+
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
|
375
|
+
|
376
|
+
[[package]]
|
377
|
+
name = "windows_x86_64_gnu"
|
378
|
+
version = "0.52.5"
|
379
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
380
|
+
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
|
369
381
|
|
370
382
|
[[package]]
|
371
|
-
name = "
|
372
|
-
version = "0.
|
383
|
+
name = "windows_x86_64_gnullvm"
|
384
|
+
version = "0.52.5"
|
373
385
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
374
|
-
checksum = "
|
386
|
+
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
|
375
387
|
|
376
388
|
[[package]]
|
377
|
-
name = "
|
378
|
-
version = "0.
|
389
|
+
name = "windows_x86_64_msvc"
|
390
|
+
version = "0.52.5"
|
379
391
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
380
|
-
checksum = "
|
392
|
+
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
|
data/Gemfile
CHANGED
@@ -5,11 +5,16 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in blake3ruby.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem "rake", "~> 13.0"
|
9
|
-
|
10
|
-
gem "rake-compiler"
|
11
8
|
gem "rb_sys"
|
12
9
|
|
13
|
-
|
10
|
+
group :development do
|
11
|
+
gem "rake", "~> 13.0"
|
12
|
+
gem "rake-compiler"
|
13
|
+
end
|
14
14
|
|
15
|
-
|
15
|
+
group :test do
|
16
|
+
gem "rspec", "~> 3.0"
|
17
|
+
gem "rubocop", "~> 1.21"
|
18
|
+
gem "rubocop-rake", require: false
|
19
|
+
gem "rubocop-rspec", require: false
|
20
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,54 +1,71 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
blake3ruby (0.
|
4
|
+
blake3ruby (0.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
|
-
diff-lcs (1.5.
|
11
|
-
json (2.
|
12
|
-
|
13
|
-
|
10
|
+
diff-lcs (1.5.1)
|
11
|
+
json (2.7.2)
|
12
|
+
language_server-protocol (3.17.0.3)
|
13
|
+
parallel (1.25.1)
|
14
|
+
parser (3.3.3.0)
|
14
15
|
ast (~> 2.4.1)
|
16
|
+
racc
|
17
|
+
racc (1.8.0)
|
15
18
|
rainbow (3.1.1)
|
16
|
-
rake (13.
|
17
|
-
rake-compiler (1.2.
|
19
|
+
rake (13.2.1)
|
20
|
+
rake-compiler (1.2.7)
|
18
21
|
rake
|
19
|
-
rb_sys (0.9.
|
20
|
-
regexp_parser (2.
|
21
|
-
rexml (3.
|
22
|
-
|
23
|
-
|
24
|
-
rspec-
|
25
|
-
rspec-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
rb_sys (0.9.97)
|
23
|
+
regexp_parser (2.9.2)
|
24
|
+
rexml (3.3.1)
|
25
|
+
strscan
|
26
|
+
rspec (3.13.0)
|
27
|
+
rspec-core (~> 3.13.0)
|
28
|
+
rspec-expectations (~> 3.13.0)
|
29
|
+
rspec-mocks (~> 3.13.0)
|
30
|
+
rspec-core (3.13.0)
|
31
|
+
rspec-support (~> 3.13.0)
|
32
|
+
rspec-expectations (3.13.1)
|
29
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-mocks (3.
|
34
|
+
rspec-support (~> 3.13.0)
|
35
|
+
rspec-mocks (3.13.1)
|
32
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.
|
34
|
-
rspec-support (3.
|
35
|
-
rubocop (1.
|
37
|
+
rspec-support (~> 3.13.0)
|
38
|
+
rspec-support (3.13.1)
|
39
|
+
rubocop (1.64.1)
|
36
40
|
json (~> 2.3)
|
41
|
+
language_server-protocol (>= 3.17.0)
|
37
42
|
parallel (~> 1.10)
|
38
|
-
parser (>= 3.
|
43
|
+
parser (>= 3.3.0.2)
|
39
44
|
rainbow (>= 2.2.2, < 4.0)
|
40
45
|
regexp_parser (>= 1.8, < 3.0)
|
41
46
|
rexml (>= 3.2.5, < 4.0)
|
42
|
-
rubocop-ast (>= 1.
|
47
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
43
48
|
ruby-progressbar (~> 1.7)
|
44
49
|
unicode-display_width (>= 2.4.0, < 3.0)
|
45
|
-
rubocop-ast (1.
|
46
|
-
parser (>= 3.
|
50
|
+
rubocop-ast (1.31.3)
|
51
|
+
parser (>= 3.3.1.0)
|
52
|
+
rubocop-rake (0.6.0)
|
53
|
+
rubocop (~> 1.0)
|
54
|
+
rubocop-rspec (3.0.1)
|
55
|
+
rubocop (~> 1.61)
|
47
56
|
ruby-progressbar (1.13.0)
|
48
|
-
|
57
|
+
strscan (3.1.0)
|
58
|
+
unicode-display_width (2.5.0)
|
49
59
|
|
50
60
|
PLATFORMS
|
51
|
-
|
61
|
+
aarch64-linux
|
62
|
+
aarch64-linux-musl
|
63
|
+
arm-linux
|
64
|
+
arm64-darwin
|
65
|
+
ruby
|
66
|
+
x86_64-darwin
|
67
|
+
x86_64-linux
|
68
|
+
x86_64-linux-musl
|
52
69
|
|
53
70
|
DEPENDENCIES
|
54
71
|
blake3ruby!
|
@@ -57,6 +74,8 @@ DEPENDENCIES
|
|
57
74
|
rb_sys
|
58
75
|
rspec (~> 3.0)
|
59
76
|
rubocop (~> 1.21)
|
77
|
+
rubocop-rake
|
78
|
+
rubocop-rspec
|
60
79
|
|
61
80
|
BUNDLED WITH
|
62
|
-
2.
|
81
|
+
2.5.13
|
data/README.md
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
# Blake3ruby
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/blake3ruby)
|
4
|
-
[](https://codeclimate.com/github/andrewblond/blake3ruby/maintainability)
|
5
|
-
[](https://codeclimate.com/github/andrewblond/blake3ruby/test_coverage)
|
6
4
|
|
7
5
|
This is a Ruby wrapper for the [BLAKE3](https://github.com/BLAKE3-team/BLAKE3) hash function written in Rust.
|
8
6
|
|
9
7
|
## Requirements
|
10
|
-
Tested on Ruby 3.1 and 3.
|
8
|
+
Tested on Ruby 3.1, 3.2 and 3.3.
|
11
9
|
You will need to have Rust installed on your system, and the `cargo` command available in your path.
|
12
10
|
See [here](https://www.rust-lang.org/tools/install) for instructions on how to install Rust.
|
13
11
|
Rust is only required to build the gem, not to use it.
|
@@ -38,7 +36,7 @@ Basic usage is similar to the `Digest` class in the Ruby standard library:
|
|
38
36
|
```ruby
|
39
37
|
require 'blake3ruby'
|
40
38
|
|
41
|
-
|
39
|
+
Digest::Blake3.hexdigest("Hello, world!") # => "ede5c0b10f2ec4979c69b52f61e42ff5b413519ce09be0f14d098dcfe5f6f98d"
|
42
40
|
```
|
43
41
|
|
44
42
|
If you want to use the streaming interface, you can use the `Blake3ruby::Hasher` class:
|
@@ -46,8 +44,8 @@ If you want to use the streaming interface, you can use the `Blake3ruby::Hasher`
|
|
46
44
|
```ruby
|
47
45
|
require 'blake3ruby'
|
48
46
|
|
49
|
-
hasher =
|
50
|
-
hasher.update("Hello, ") # => #<
|
47
|
+
hasher = Digest::Blake3::Hasher.new
|
48
|
+
hasher.update("Hello, ") # => #<Digest::Blake3::Hasher:0x00000001066f59a8> - returns self
|
51
49
|
hasher.update("world!")
|
52
50
|
hasher.finalize # => "ede5c0b10f2ec4979c69b52f61e42ff5b413519ce09be0f14d098dcfe5f6f98d"
|
53
51
|
```
|
@@ -62,9 +60,13 @@ The derive_key mode takes a context string and some key material (not a password
|
|
62
60
|
```ruby
|
63
61
|
require 'blake3ruby'
|
64
62
|
|
65
|
-
|
63
|
+
Digest::Blake3.derive_key("context", "input_key_material") # => "3eaa9796d6d3db5cd5de00d44e4888fccbf4f8c878dd6ccd0c374bded6c26405"
|
66
64
|
```
|
67
65
|
|
66
|
+
## Breaking Changes in Version 0.2.0
|
67
|
+
|
68
|
+
In versions 0.1.0 and 0.1.1, the Blake3ruby namespace was available. Starting from version 0.2.0, the Blake3 crypto digest has been moved to the Digest namespace where all standard Ruby digests are available. This change ensures consistency and better integration with the Ruby standard library.
|
69
|
+
|
68
70
|
## Performance
|
69
71
|
|
70
72
|
The performance of this gem is comparable to the performance of the [blake3](https://github.com/BLAKE3-team/BLAKE3)
|
@@ -72,14 +74,53 @@ crate, which is written in Rust.
|
|
72
74
|
|
73
75
|
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.
|
74
76
|
```
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
SHA3-
|
79
|
-
SHA3-
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
MD5 (13 chars): 6.141045 0.086745 6.227790 ( 6.263524)
|
78
|
+
SHA1 (13 chars): 6.230957 0.080145 6.311102 ( 6.333384)
|
79
|
+
SHA3-256 (13 chars): 6.364485 0.093261 6.457746 ( 6.491053)
|
80
|
+
SHA3-384 (13 chars): 7.068870 0.151501 7.220371 ( 7.246571)
|
81
|
+
SHA3-512 (13 chars): 7.265794 0.152058 7.417852 ( 7.443591)
|
82
|
+
RMD160 (13 chars): 5.547123 0.075290 5.622413 ( 5.642165)
|
83
|
+
blake3 (13 chars): 2.747356 0.014433 2.761789 ( 2.772582)
|
84
|
+
|
85
|
+
For message length 13 chars:
|
86
|
+
Fastest: blake3 with 2.7725820001214743 seconds
|
87
|
+
Slowest: SHA3-512 with 7.44359099981375 seconds
|
88
|
+
user system total real
|
89
|
+
MD5 (44 chars): 5.861548 0.074899 5.936447 ( 5.959032)
|
90
|
+
SHA1 (44 chars): 5.944156 0.072394 6.016550 ( 6.038251)
|
91
|
+
SHA3-256 (44 chars): 6.446754 0.096381 6.543135 ( 6.570512)
|
92
|
+
SHA3-384 (44 chars): 7.083944 0.156259 7.240203 ( 7.268630)
|
93
|
+
SHA3-512 (44 chars): 7.213243 0.154452 7.367695 ( 7.396536)
|
94
|
+
RMD160 (44 chars): 5.589189 0.075830 5.665019 ( 5.689458)
|
95
|
+
blake3 (44 chars): 2.754475 0.014872 2.769347 ( 2.780263)
|
96
|
+
|
97
|
+
For message length 44 chars:
|
98
|
+
Fastest: blake3 with 2.7802629999350756 seconds
|
99
|
+
Slowest: SHA3-512 with 7.396536000072956 seconds
|
100
|
+
user system total real
|
101
|
+
MD5 (199 chars): 8.079411 0.088239 8.167650 ( 8.201427)
|
102
|
+
SHA1 (199 chars): 7.792639 0.082953 7.875592 ( 7.904909)
|
103
|
+
SHA3-256 (199 chars): 9.508372 0.106791 9.615163 ( 9.648153)
|
104
|
+
SHA3-384 (199 chars): 8.291785 0.160924 8.452709 ( 8.483978)
|
105
|
+
SHA3-512 (199 chars): 8.396180 0.160054 8.556234 ( 8.590455)
|
106
|
+
RMD160 (199 chars): 8.910650 0.087215 8.997865 ( 9.028016)
|
107
|
+
blake3 (199 chars): 3.796439 0.018845 3.815284 ( 3.829479)
|
108
|
+
|
109
|
+
For message length 199 chars:
|
110
|
+
Fastest: blake3 with 3.8294790000654757 seconds
|
111
|
+
Slowest: SHA3-256 with 9.648153000045568 seconds
|
112
|
+
user system total real
|
113
|
+
MD5 (1024 chars): 15.504161 0.114951 15.619112 ( 15.671606)
|
114
|
+
SHA1 (1024 chars): 13.007605 0.105566 13.113171 ( 13.163242)
|
115
|
+
SHA3-256 (1024 chars): 20.968764 0.162367 21.131131 ( 21.212766)
|
116
|
+
SHA3-384 (1024 chars): 17.255475 0.300950 17.556425 ( 17.728562)
|
117
|
+
SHA3-512 (1024 chars): 17.697881 0.400774 18.098655 ( 18.404827)
|
118
|
+
RMD160 (1024 chars): 23.639904 0.458113 24.098017 ( 24.535302)
|
119
|
+
blake3 (1024 chars): 8.123303 0.178863 8.302166 ( 8.499843)
|
120
|
+
|
121
|
+
For message length 1024 chars:
|
122
|
+
Fastest: blake3 with 8.499842999968678 seconds
|
123
|
+
Slowest: RMD160 with 24.535302000120282 seconds
|
83
124
|
```
|
84
125
|
|
85
126
|
Another benchmark was run on a 2022 MacBook Pro with a Apple M1 processor and 16 GB of RAM.
|
data/Rakefile
CHANGED
data/blake3ruby.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/blake3ruby/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "blake3ruby"
|
7
|
+
spec.version = Blake3ruby::VERSION
|
8
|
+
spec.authors = ["Nightforge"]
|
9
|
+
spec.email = ["modo00@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Ruby bindings for the blake3 hash function"
|
12
|
+
spec.description = "Ruby bindings for the blake3 hash function using the Rust implementation"
|
13
|
+
spec.homepage = "https://github.com/Nightforge/blake3ruby"
|
14
|
+
spec.required_ruby_version = ">= 3.0"
|
15
|
+
spec.required_rubygems_version = ">= 3.3.11"
|
16
|
+
spec.licenses = %w[MIT Ruby]
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/Nightforge/blake3ruby"
|
20
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(__dir__) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(File.expand_path(f) == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
spec.files << %w[Cargo.lock LICENSE.txt README.md]
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
spec.extensions = ["ext/blake3ruby/Cargo.toml"]
|
34
|
+
end
|
data/ext/blake3ruby/Cargo.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[package]
|
2
2
|
name = "blake3ruby"
|
3
|
-
version = "0.
|
3
|
+
version = "0.2.0"
|
4
4
|
edition = "2021"
|
5
5
|
authors = ["Nightforge <modo00@gmail.com>"]
|
6
6
|
publish = false
|
@@ -9,6 +9,9 @@ publish = false
|
|
9
9
|
crate-type = ["cdylib"]
|
10
10
|
|
11
11
|
[dependencies]
|
12
|
-
magnus = { version = "0.
|
12
|
+
magnus = { version = "0.7.1" }
|
13
13
|
hex = { version = "0.4.3" }
|
14
|
-
blake3 = "1.
|
14
|
+
blake3 = { version = "1.5.1" }
|
15
|
+
|
16
|
+
[package.metadata.magnus]
|
17
|
+
rbconfig = true
|
data/ext/blake3ruby/src/lib.rs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
use magnus::{define_module,
|
1
|
+
use magnus::{define_module, class, function, method, prelude::*, Error};
|
2
2
|
|
3
3
|
fn hexdigest(subject: String) -> String {
|
4
4
|
let hash = blake3::hash(subject.as_bytes());
|
5
|
-
return hash.to_string()
|
5
|
+
return hash.to_string();
|
6
6
|
}
|
7
7
|
|
8
8
|
fn derive_key(context: String, key: String) -> String {
|
@@ -15,7 +15,7 @@ struct Hasher {
|
|
15
15
|
hasher: blake3::Hasher,
|
16
16
|
}
|
17
17
|
|
18
|
-
#[magnus::wrap(class = "Hasher")]
|
18
|
+
#[magnus::wrap(class = "Digest::Blake3::Hasher")]
|
19
19
|
struct MutHasher(std::cell::RefCell<Hasher>);
|
20
20
|
|
21
21
|
impl MutHasher {
|
@@ -28,26 +28,27 @@ impl MutHasher {
|
|
28
28
|
|
29
29
|
fn update(&self, subject: String) -> Self {
|
30
30
|
self.0.borrow_mut().hasher.update(subject.as_bytes());
|
31
|
-
return Self(self.0.clone())
|
31
|
+
return Self(self.0.clone());
|
32
32
|
}
|
33
33
|
|
34
34
|
fn finalize(&self) -> String {
|
35
35
|
let hash = self.0.borrow().hasher.finalize();
|
36
|
-
return hash.to_string()
|
36
|
+
return hash.to_string();
|
37
37
|
}
|
38
38
|
}
|
39
39
|
|
40
40
|
#[magnus::init]
|
41
41
|
fn init() -> Result<(), Error> {
|
42
|
-
let
|
43
|
-
|
44
|
-
|
42
|
+
let digest = define_module("Digest")?;
|
43
|
+
let blake3 = digest.define_module("Blake3")?;
|
44
|
+
|
45
|
+
blake3.define_singleton_method("hexdigest", function!(hexdigest, 1))?;
|
46
|
+
blake3.define_singleton_method("derive_key", function!(derive_key, 2))?;
|
45
47
|
|
46
|
-
let class = define_class("Hasher", class::object())?;
|
48
|
+
let class = blake3.define_class("Hasher", class::object())?;
|
47
49
|
class.define_singleton_method("new", function!(MutHasher::new, 0))?;
|
48
50
|
class.define_method("update", method!(MutHasher::update, 1))?;
|
49
51
|
class.define_method("finalize", method!(MutHasher::finalize, 0))?;
|
50
52
|
|
51
|
-
blake3ruby.define_class("Hasher", class)?;
|
52
53
|
Ok(())
|
53
54
|
}
|
data/lib/blake3ruby/version.rb
CHANGED
data/sig/blake3ruby.rbs
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
module Blake3ruby
|
2
2
|
VERSION: String
|
3
|
-
|
3
|
+
end
|
4
|
+
|
5
|
+
module Digest
|
6
|
+
module Blake3
|
7
|
+
def self.hexdigest(subject: String) -> String
|
8
|
+
def self.derive_key(context: String, key: String) -> String
|
9
|
+
|
10
|
+
class Hasher
|
11
|
+
def self.new: () -> Digest::Blake3::Hasher
|
12
|
+
def update: (subject: String) -> Digest::Blake3::Hasher
|
13
|
+
def finalize: () -> String
|
14
|
+
end
|
15
|
+
end
|
4
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blake3ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nightforge
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby bindings for the blake3 hash function using the Rust implementation
|
14
14
|
email:
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- LICENSE.txt
|
29
29
|
- README.md
|
30
30
|
- Rakefile
|
31
|
+
- blake3ruby.gemspec
|
31
32
|
- ext/blake3ruby/Cargo.toml
|
32
33
|
- ext/blake3ruby/extconf.rb
|
33
34
|
- ext/blake3ruby/src/lib.rs
|
@@ -41,6 +42,7 @@ licenses:
|
|
41
42
|
metadata:
|
42
43
|
homepage_uri: https://github.com/Nightforge/blake3ruby
|
43
44
|
source_code_uri: https://github.com/Nightforge/blake3ruby
|
45
|
+
rubygems_mfa_required: 'true'
|
44
46
|
post_install_message:
|
45
47
|
rdoc_options: []
|
46
48
|
require_paths:
|
@@ -56,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
58
|
- !ruby/object:Gem::Version
|
57
59
|
version: 3.3.11
|
58
60
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
61
|
+
rubygems_version: 3.5.13
|
60
62
|
signing_key:
|
61
63
|
specification_version: 4
|
62
64
|
summary: Ruby bindings for the blake3 hash function
|