substrate_common.rb 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/substrate_common/version.rb +1 -1
- data/lib/substrate_common.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bc5dff23465573f86fa0e27fc876e762ebe99f26ecaec2b3049b948060527aa
|
4
|
+
data.tar.gz: 1cb977d2013ebf8f6752b4129113dabe72967518b3b0fe6978df93654ba84970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4c61d14e1612f1222a8f874145003823a22e8cb90461c1653852383dbfa0c23d1babc4bd7d6e86bf5f56056498370240741ecdb1add76a7e6f1b90d31a189eb
|
7
|
+
data.tar.gz: 564bcd315d02d273764bb15c5728a09e4a0d8260a998e57fee3ec00c0ed7935ecd29a18bb5d35b65cfd5c751f8c401514fbc4cb67301258d44b0541631d0b0a5
|
data/Gemfile.lock
CHANGED
data/lib/substrate_common.rb
CHANGED
@@ -45,16 +45,17 @@ class String
|
|
45
45
|
end
|
46
46
|
|
47
47
|
module Crypto
|
48
|
-
def xxhash_128(data)
|
48
|
+
def self.xxhash_128(data)
|
49
49
|
bytes = []
|
50
50
|
2.times do |i|
|
51
51
|
result = XXhash.xxh64 data, i
|
52
52
|
bytes = bytes + result.to_s(16).rjust(16, '0').hex_to_bytes.reverse
|
53
53
|
end
|
54
|
-
bytes.bytes_to_hex
|
54
|
+
bytes.bytes_to_hex[2..]
|
55
55
|
end
|
56
56
|
|
57
|
-
def black2_256(data)
|
57
|
+
def self.black2_256(data)
|
58
|
+
# data = hex.hex_to_bytes.bytes_to_utf8
|
58
59
|
Blake2b.hex data, Blake2b::Key.none, 32
|
59
60
|
end
|
60
61
|
end
|