bitcoin-cigs 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bitcoin-cigs (0.0.4)
4
+ bitcoin-cigs (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -13,7 +13,7 @@ module BitcoinCigs
13
13
 
14
14
  leading_zeros = /^#{CHARS[0]}*/.match(s).to_s.size
15
15
 
16
- ["#{"\x00\x00" * leading_zeros}#{int_val.to_s(16)}"].pack('H*')
16
+ ["#{"00" * leading_zeros}#{int_val.to_s(16)}"].pack('H*')
17
17
  end
18
18
 
19
19
  def self.encode(s)
@@ -38,47 +38,5 @@ module BitcoinCigs
38
38
 
39
39
  result
40
40
  end
41
-
42
- # def self.encode(s)
43
- # int_val = s.unpack('H*').first.to_i(16)
44
- #
45
- # var bi = BigInteger.fromByteArrayUnsigned(input);
46
- # var chars = [];
47
- #
48
- # while (bi.compareTo(B58.base) >= 0) {
49
- # var mod = bi.mod(B58.base);
50
- # chars.unshift(B58.alphabet[mod.intValue()]);
51
- # bi = bi.subtract(mod).divide(B58.base);
52
- # }
53
- # chars.unshift(B58.alphabet[bi.intValue()]);
54
- #
55
- # for (var i = 0; i < input.length; i++) {
56
- # if (input[i] == 0x00) {
57
- # chars.unshift(B58.alphabet[0]);
58
- # } else break;
59
- # }
60
- #
61
- # return chars.join('');
62
- # end
63
-
64
- # def self.encode(s)
65
- # value = 0
66
- #
67
- # value = s.chars.reverse_each.each_with_index.inject(0) { |acc, (ch, i)| acc + (256 ** i) * ch.ord }
68
- #
69
- # result = []
70
- # while value >= CHAR_SIZE
71
- # div, mod = value / CHAR_SIZE, value % CHAR_SIZE
72
- # result.unshift(CHARS[mod])
73
- # value = div
74
- # end
75
- # result.unshift(CHARS[value])
76
- #
77
- # pad_size = s.chars.inject(0) { |acc, ch| acc + (ch == "\0" ? 1 : 0) }
78
- #
79
- # result.unshift(CHARS[0] * pad_size)
80
- #
81
- # result.join
82
- # end
83
41
  end
84
42
  end
@@ -1,3 +1,3 @@
1
1
  module BitcoinCigs
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitcoin-cigs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: