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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 638fba2600d5e49cc76c26aeed7da323568e0064
4
- data.tar.gz: f9741d00c2fbbf8d75d5d2d8da6a8e9128f3a9a0
3
+ metadata.gz: 7c0aae999751b43b648ba96d17650988e53b1eab
4
+ data.tar.gz: f54e3401230894089309f502d7518f85c0c7b09f
5
5
  SHA512:
6
- metadata.gz: 6d3c7763b04e3c769e20be2080c31adcc21fcdda26fa8553a1c2be99233cc6c1b833f2788aaf5d0113a52b952b2b6abdf669f25f543d8aacfde5e40fce57ece9
7
- data.tar.gz: 97985c8319560e90f7614c26aa524d2528632884c483303a6d597a98c2427acd09d9e3dc26f07908e3871e6cc2dcf34406f9e145f4ee4b1459a2e726715faad1
6
+ metadata.gz: 1b487675d3ac5a29cdaf1813a8e22f34681f02fa2b765f71a705041f84ae18a59458f5b132e7dda15d2071a676d303bc475b67d6098a21fc8fbd9e00717705d8
7
+ data.tar.gz: 618c590a7f6f9d6391f48de32115201d0c9b9691e7c5614cf28ea7eea94d86e2645925f13a5438b30077a4d125bbe86df9b3a51d0f0e3f4f99288689bc0c2597
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coin-address-validators (0.0.4)
4
+ coin-address-validators (0.0.5)
5
5
  base_x
6
6
  bitcoin-ruby
7
7
  cashaddress
@@ -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
@@ -1,3 +1,3 @@
1
1
  class CoinAddressValidators
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -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
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-23 00:00:00.000000000 Z
11
+ date: 2018-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitcoin-ruby