substrate_common.rb 0.1.5 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 227fc5f59d0619c28cd6b00ca7d8d110ada166c153b3c4361df9cf17cea8b513
4
- data.tar.gz: 609e958257fcf763604642e4f4724ff98952ae7d02eafdd0457f96822e7b3711
3
+ metadata.gz: 4bc5dff23465573f86fa0e27fc876e762ebe99f26ecaec2b3049b948060527aa
4
+ data.tar.gz: 1cb977d2013ebf8f6752b4129113dabe72967518b3b0fe6978df93654ba84970
5
5
  SHA512:
6
- metadata.gz: b851b2868a4c911618cd6f2e9ef951e0a1156ff09182e0081240ba82416bb471dacca6f630ab576f92161c4ff7ef48c77c9f233df095f8d98265c5e966a271e6
7
- data.tar.gz: 22db7541c17911b9a82d5822e4e5c5999f8e29270ddda56007908cb06be86c058e15b5c5c1e75dcdf62bfb38148a351e497df61fe88561aaa3708469c0a51f1f
6
+ metadata.gz: c4c61d14e1612f1222a8f874145003823a22e8cb90461c1653852383dbfa0c23d1babc4bd7d6e86bf5f56056498370240741ecdb1add76a7e6f1b90d31a189eb
7
+ data.tar.gz: 564bcd315d02d273764bb15c5728a09e4a0d8260a998e57fee3ec00c0ed7935ecd29a18bb5d35b65cfd5c751f8c401514fbc4cb67301258d44b0541631d0b0a5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- substrate_common.rb (0.1.5)
4
+ substrate_common.rb (0.1.6)
5
5
  base58
6
6
  blake2b
7
7
  xxhash
@@ -1,3 +1,3 @@
1
1
  module SubstrateCommon
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: substrate_common.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wu Minzhe