substrate_common.rb 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b498c9f38624f9dec4a75c5be6dcf7300d4eac30f4e102b0b3c5e7df8ce6c179
4
- data.tar.gz: ce75f39461e45e2326b251052abe3cb8446a0e5259d75c1e90699920e0cb48a4
3
+ metadata.gz: 227fc5f59d0619c28cd6b00ca7d8d110ada166c153b3c4361df9cf17cea8b513
4
+ data.tar.gz: 609e958257fcf763604642e4f4724ff98952ae7d02eafdd0457f96822e7b3711
5
5
  SHA512:
6
- metadata.gz: 8da3cff9f56dd5e806fb7fb28ee97a299db47c6033ad9165857c9a8dbf881b1b0d475aac3bdbd37599c0c76fa84d5563394f6ead1d66319f7579e50d8827fba3
7
- data.tar.gz: a3f072e090d242a1216a7b9f34f8613b5cde6f597ddf3f367c6bfdece33be20e68da8dc9d1710a4a7edbed3df4146b2856dc35d434e6f25b642656e458f9e1c3
6
+ metadata.gz: b851b2868a4c911618cd6f2e9ef951e0a1156ff09182e0081240ba82416bb471dacca6f630ab576f92161c4ff7ef48c77c9f233df095f8d98265c5e966a271e6
7
+ data.tar.gz: 22db7541c17911b9a82d5822e4e5c5999f8e29270ddda56007908cb06be86c058e15b5c5c1e75dcdf62bfb38148a351e497df61fe88561aaa3708469c0a51f1f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- substrate_common.rb (0.1.4)
4
+ substrate_common.rb (0.1.5)
5
5
  base58
6
6
  blake2b
7
7
  xxhash
@@ -1,3 +1,3 @@
1
1
  module SubstrateCommon
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -44,11 +44,17 @@ class String
44
44
  end
45
45
  end
46
46
 
47
- def xxhash128(data)
48
- bytes = []
49
- 2.times do |i|
50
- result = XXhash.xxh64 data, i
51
- bytes = bytes + result.to_s(16).rjust(16, '0').hex_to_bytes.reverse
47
+ module Crypto
48
+ def xxhash_128(data)
49
+ bytes = []
50
+ 2.times do |i|
51
+ result = XXhash.xxh64 data, i
52
+ bytes = bytes + result.to_s(16).rjust(16, '0').hex_to_bytes.reverse
53
+ end
54
+ bytes.bytes_to_hex
55
+ end
56
+
57
+ def black2_256(data)
58
+ Blake2b.hex data, Blake2b::Key.none, 32
52
59
  end
53
- bytes.bytes_to_hex
54
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: substrate_common.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wu Minzhe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-16 00:00:00.000000000 Z
11
+ date: 2020-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blake2b