ffi-libsodium 0.2.5 → 0.2.6
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/lib/sodium.rb +4 -2
- data/lib/sodium/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e6e1510ebcfd34a4dd4dc8aa56cd6b670a4a954
|
4
|
+
data.tar.gz: 011c860257aa7e3c7e2317a8004af503fafd0011
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949283ba864307aae5c029a0808e1d5c29e2749b7ecb2067138467e7c7cc4daad95d97c9e83cd7297fd7bb8b02c0bc9b335dee22d50f56a7bf56aabecfe4350c
|
7
|
+
data.tar.gz: cc94b8afde6ecee00a857392faa8b060e2c32b361ac76a7f4856f4f00cef3c29d6ca32866efbdc2315243c168c167bff655731328d37654550c6144024e7a8db
|
data/lib/sodium.rb
CHANGED
@@ -63,8 +63,10 @@ module Sodium
|
|
63
63
|
|
64
64
|
def hex2bin(hex, bin_maxlen, ignore = nil)
|
65
65
|
bin = Sodium::Buffer.new(:uchar, bin_maxlen)
|
66
|
-
|
67
|
-
|
66
|
+
bin_len = FFI::MemoryPointer.new(:size_t)
|
67
|
+
if sodium_hex2bin(bin, bin_maxlen, hex, hex.bytesize, ignore, bin_len, nil) == 0
|
68
|
+
size = bin_len.size == 8 ? bin_len.read_uint64 : bin_len.read_uint32
|
69
|
+
[bin, size]
|
68
70
|
else
|
69
71
|
raise LengthError, "bin_maxlen=#{bin_maxlen} is too short", caller
|
70
72
|
end
|
data/lib/sodium/version.rb
CHANGED