coin-address-validators 0.0.4 → 0.0.5
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/coin-address-validators.rb +1 -1
- data/lib/coin-address-validators/version.rb +1 -1
- data/spec/lib/coin-address-validators_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c0aae999751b43b648ba96d17650988e53b1eab
|
4
|
+
data.tar.gz: f54e3401230894089309f502d7518f85c0c7b09f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b487675d3ac5a29cdaf1813a8e22f34681f02fa2b765f71a705041f84ae18a59458f5b132e7dda15d2071a676d303bc475b67d6098a21fc8fbd9e00717705d8
|
7
|
+
data.tar.gz: 618c590a7f6f9d6391f48de32115201d0c9b9691e7c5614cf28ea7eea94d86e2645925f13a5438b30077a4d125bbe86df9b3a51d0f0e3f4f99288689bc0c2597
|
data/Gemfile.lock
CHANGED
@@ -61,7 +61,7 @@ class CoinAddressValidators
|
|
61
61
|
|
62
62
|
def valid?(address)
|
63
63
|
hex = XRPBASE58.decode(address).bth
|
64
|
-
addr = hex[0...-8]
|
64
|
+
addr = hex[0...-8].rjust(42, "0")
|
65
65
|
checksum = hex[-8..-1]
|
66
66
|
Digest::SHA256.hexdigest(Digest::SHA256.digest(addr.htb))[0...8] == checksum
|
67
67
|
rescue BaseX::InvalidNumeral => e
|
@@ -46,6 +46,7 @@ RSpec.describe CoinAddressValidators do
|
|
46
46
|
expect(CoinAddressValidators["xrp"].valid?("r!!!")).to be_falsey
|
47
47
|
expect(CoinAddressValidators["xrp"].valid?("rQGwKPE63Mmi9QdswwxKkVUxp6joqFbjzm")).to be_falsey
|
48
48
|
expect(CoinAddressValidators["xrp"].valid?("rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC")).to be_truthy
|
49
|
+
expect(CoinAddressValidators["xrp"].valid?("rkbwLDZywoUVcjfrQzY7ccjSwnnXmJo6F")).to be_truthy
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coin-address-validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phuong Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitcoin-ruby
|