blake3-rb 1.5.4.1 → 1.5.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/digest/blake3_ext/src/bindings.rs +34 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ab3f1082c343de16df3d08889bde6ef229bb70889a6e6587e56fbb85e16489d
|
4
|
+
data.tar.gz: aaf3164981b071fe3c06897c67bbc76503c564adf98170048350589b3008a323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77561b2a749a2f8fd5d80d1a603ff36657bbb3263089a6d832810ccd1a25c5444373d9c7d1bc3c8b7a782794ef099cc021b363952bca657496f44558850fc19c
|
7
|
+
data.tar.gz: 7335f1d78da1f485ca638a5b3cb60ccbf805642293555bfd37a8fad72bdf45ad1cc8ee5b7dad19e71b2a69ab61908375ae206c8c432e8cf363099cd60a8cbf42
|
@@ -1,7 +1,6 @@
|
|
1
|
+
use rb_sys::{size_t, VALUE};
|
1
2
|
use std::ffi::{c_int, c_uchar, c_void};
|
2
3
|
|
3
|
-
use rb_sys::{rb_data_object_wrap, rb_obj_freeze, size_t, VALUE};
|
4
|
-
|
5
4
|
pub const RUBY_DIGEST_API_VERSION: c_int = 3;
|
6
5
|
|
7
6
|
pub type RbDigestHashInitFuncT = unsafe extern "C" fn(*mut c_void) -> c_int;
|
@@ -20,7 +19,40 @@ pub struct RbDigestMetadataT {
|
|
20
19
|
pub finish_func: RbDigestHashFinishFuncT,
|
21
20
|
}
|
22
21
|
|
22
|
+
#[cfg(ruby_gt_3_3)]
|
23
|
+
pub unsafe fn rb_digest_make_metadata(meta: &'static RbDigestMetadataT) -> VALUE {
|
24
|
+
static mut WRAPPER: Option<unsafe extern "C" fn(&'static RbDigestMetadataT) -> VALUE> = None;
|
25
|
+
|
26
|
+
unsafe fn load_wrapper() {
|
27
|
+
use rb_sys::rb_ext_resolve_symbol;
|
28
|
+
use std::ffi::c_char;
|
29
|
+
use std::sync::Once;
|
30
|
+
|
31
|
+
static INIT: Once = Once::new();
|
32
|
+
|
33
|
+
INIT.call_once(|| {
|
34
|
+
let lib_name = "digest.so\0".as_ptr() as *const c_char;
|
35
|
+
let symbol_name = "rb_digest_wrap_metadata\0".as_ptr() as *const c_char;
|
36
|
+
let symbol_ptr = rb_ext_resolve_symbol(lib_name, symbol_name);
|
37
|
+
|
38
|
+
if !symbol_ptr.is_null() {
|
39
|
+
WRAPPER = Some(std::mem::transmute(symbol_ptr));
|
40
|
+
} else {
|
41
|
+
panic!("Failed to resolve rb_digest_wrap_metadata");
|
42
|
+
}
|
43
|
+
});
|
44
|
+
}
|
45
|
+
|
46
|
+
load_wrapper();
|
47
|
+
if let Some(wrapper) = WRAPPER {
|
48
|
+
return wrapper(meta);
|
49
|
+
}
|
50
|
+
panic!("Failed to resolve rb_digest_wrap_metadata");
|
51
|
+
}
|
52
|
+
|
53
|
+
#[cfg(not(ruby_gt_3_3))]
|
23
54
|
pub unsafe fn rb_digest_make_metadata(meta: &'static RbDigestMetadataT) -> VALUE {
|
55
|
+
use rb_sys::{rb_data_object_wrap, rb_obj_freeze};
|
24
56
|
let data = rb_data_object_wrap(
|
25
57
|
0 as VALUE,
|
26
58
|
meta as *const RbDigestMetadataT as *mut c_void,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blake3-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.4.
|
4
|
+
version: 1.5.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb_sys
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
67
|
+
rubygems_version: 3.5.3
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: Blake3 hash function bindings for Ruby.
|