base58 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ rdoc
2
+ *.gem
3
+ .DS_Store
@@ -0,0 +1,8 @@
1
+ = 0.0.3
2
+ - Removed accidental dependencies.
3
+
4
+ = 0.0.2
5
+ - Fixed typos.
6
+
7
+ = 0.0.1
8
+ - Initial release.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Douglas F Shearer
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,38 @@
1
+ = Base58
2
+
3
+ If you find this library useful, please consider a donation to show your support!
4
+
5
+ http://www.paypal.com/cgi-bin/webscr?cmd=_send-money
6
+
7
+ Paypal address: mailto:dougal.s@gmail.com
8
+
9
+ === Install
10
+
11
+ $ gem sources -a http://gems.github.com (you only have to do this once)
12
+ $ sudo gem install dougal-base58
13
+
14
+ == Usage
15
+
16
+ require 'rubygems'
17
+ require 'base58'
18
+
19
+ # Int to Base58
20
+ Base58.int_to_base58(12345) # => 4ER
21
+
22
+ # Base58 to Int
23
+ Base58.base58_to_int('A2Ph') # => 6639914
24
+
25
+ == RDoc Documentation
26
+
27
+ You can view the rdoc documentation online[http://douglasfshearer.com/rdoc/base58/].
28
+
29
+ == Problems, Comments, Suggestions?
30
+
31
+ All of the above are most welcome. mailto:dougal.s@gmail.com
32
+
33
+
34
+ == Credits
35
+
36
+ Douglas F Shearer - http://douglasfshearer.com
37
+
38
+ Test examples courtesy Fraser Speirs' Base58Encoder Objective-C class, http://gist.github.com/101674.
@@ -0,0 +1,37 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+
5
+ desc 'Default: run unit tests.'
6
+ task :default => :test
7
+
8
+ desc 'Test the base58 library.'
9
+ Rake::TestTask.new do |t|
10
+ t.libs << 'lib'
11
+ t.pattern = 'test/**/test_*.rb'
12
+ t.verbose = false
13
+ end
14
+
15
+ desc 'Generate RDoc documentation.'
16
+ Rake::RDocTask.new do |rdoc|
17
+ rdoc.rdoc_dir = 'rdoc'
18
+ rdoc.title = 'base58'
19
+ rdoc.options << '--line-numbers' << '--inline-source'
20
+ rdoc.rdoc_files.include('README.rdoc')
21
+ rdoc.rdoc_files.include('lib/**/*.rb')
22
+ end
23
+
24
+ begin
25
+ require 'jeweler'
26
+ Jeweler::Tasks.new do |gemspec|
27
+ gemspec.name = "base58"
28
+ gemspec.summary = "Base58 is a Ruby library for converting ints to and from base58."
29
+ gemspec.description = gemspec.summary
30
+ gemspec.email = "dougal.s@gmail.com"
31
+ gemspec.homepage = "http://github.com/dougal/base58"
32
+ gemspec.authors = ["Douglas F Shearer"]
33
+ end
34
+ Jeweler::GemcutterTasks.new
35
+ rescue LoadError
36
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
37
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.3
@@ -0,0 +1,48 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{base58}
8
+ s.version = "0.0.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Douglas F Shearer"]
12
+ s.date = %q{2009-11-05}
13
+ s.description = %q{Base58 is a Ruby library for converting ints to and from base58.}
14
+ s.email = %q{dougal.s@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "CHANGELOG",
21
+ "MIT-LICENSE",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "base58.gemspec",
26
+ "lib/base58.rb",
27
+ "test/test_base58.rb"
28
+ ]
29
+ s.homepage = %q{http://github.com/dougal/base58}
30
+ s.rdoc_options = ["--charset=UTF-8"]
31
+ s.require_paths = ["lib"]
32
+ s.rubygems_version = %q{1.3.5}
33
+ s.summary = %q{Base58 is a Ruby library for converting ints to and from base58.}
34
+ s.test_files = [
35
+ "test/test_base58.rb"
36
+ ]
37
+
38
+ if s.respond_to? :specification_version then
39
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
40
+ s.specification_version = 3
41
+
42
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
43
+ else
44
+ end
45
+ else
46
+ end
47
+ end
48
+
@@ -0,0 +1,31 @@
1
+ # Base58
2
+ # Copyright (c) 2009 Douglas F Shearer.
3
+ # http://douglasfshearer.com
4
+ # Distributed under the MIT license as included with this plugin.
5
+
6
+ class Base58
7
+
8
+ ALPHABET = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
9
+ BASE = ALPHABET.length
10
+
11
+ # Converts a base58 string to a base10 integer.
12
+ def self.base58_to_int(base58_val)
13
+ int_val = 0
14
+ base58_val.reverse.split(//).each_with_index do |char,index|
15
+ int_val += (ALPHABET.index(char))*(BASE**(index))
16
+ end
17
+ int_val
18
+ end
19
+
20
+ # Converts a base10 integer to a base58 string.
21
+ def self.int_to_base58(int_val)
22
+ base58_val = ''
23
+ while(int_val >= BASE)
24
+ mod = int_val % BASE
25
+ base58_val = ALPHABET[mod,1] + base58_val
26
+ int_val = (int_val - mod)/BASE
27
+ end
28
+ ALPHABET[int_val,1] + base58_val
29
+ end
30
+
31
+ end
@@ -0,0 +1,518 @@
1
+ require 'test/unit'
2
+ require 'base58'
3
+
4
+ class TestBase58 < Test::Unit::TestCase
5
+
6
+ EXAMPLES = { "6hKMCS" => 3471391110,
7
+ "6hDrmR" => 3470152229,
8
+ "6hHHZB" => 3470988633,
9
+ "6hHKum" => 3470993664,
10
+ "6hLgFW" => 3471485480,
11
+ "6hBRKR" => 3469844075,
12
+ "6hGRTd" => 3470820062,
13
+ "6hCuie" => 3469966999,
14
+ "6hJuXN" => 3471139908,
15
+ "6hJsyS" => 3471131850,
16
+ "6hFWFb" => 3470641072,
17
+ "6hENdZ" => 3470417529,
18
+ "6hEJqg" => 3470404727,
19
+ "6hGNaq" => 3470807546,
20
+ "6hDRoZ" => 3470233089,
21
+ "6hKkP9" => 3471304242,
22
+ "6hHVZ3" => 3471028968,
23
+ "6hNcfE" => 3471860782,
24
+ "6hJBqs" => 3471161638,
25
+ "6hCPyc" => 3470031783,
26
+ "6hJNrC" => 3471198710,
27
+ "6hKmkd" => 3471305986,
28
+ "6hFUYs" => 3470635346,
29
+ "6hK6UC" => 3471257464,
30
+ "6hBmiv" => 3469744991,
31
+ "6hKex1" => 3471283122,
32
+ "6hFHQj" => 3470597870,
33
+ "6hCA2n" => 3469986263,
34
+ "6hBTgt" => 3469849157,
35
+ "6hHEss" => 3470976734,
36
+ "6hLows" => 3471508478,
37
+ "6hD95z" => 3470094097,
38
+ "6hKjcq" => 3471298806,
39
+ "6hGEbd" => 3470780680,
40
+ "6hKSNS" => 3471408510,
41
+ "6hG8hv" => 3470676761,
42
+ "6hEmj6" => 3470330361,
43
+ "6hGjpn" => 3470714163,
44
+ "6hEsUr" => 3470352537,
45
+ "6hJEhy" => 3471171272,
46
+ "6hKBHn" => 3471357731,
47
+ "6hG3gi" => 3470659871,
48
+ "6hFJTT" => 3470601441,
49
+ "6hLZDs" => 3471626624,
50
+ "6hGdL7" => 3470695182,
51
+ "6hBpi4" => 3469755057,
52
+ "6hEuFV" => 3470358539,
53
+ "6hGVw1" => 3470832288,
54
+ "6hLdm1" => 3471474232,
55
+ "6hFcCK" => 3470496279,
56
+ "6hDZmR" => 3470259877,
57
+ "6hG8iX" => 3470676845,
58
+ "6hFZZL" => 3470652242,
59
+ "6hJ79u" => 3471063156,
60
+ "6hMsrS" => 3471716780,
61
+ "6hGH3G" => 3470790336,
62
+ "6hKqD3" => 3471320476,
63
+ "6hKxEY" => 3471344136,
64
+ "6hHVF1" => 3471027922,
65
+ "6hKDSQ" => 3471365008,
66
+ "6hKwHs" => 3471340916,
67
+ "6hH4s6" => 3470858973,
68
+ "6hGmKB" => 3470722065,
69
+ "6hEzdi" => 3470373757,
70
+ "6hJQwJ" => 3471205734,
71
+ "6hHd6a" => 3470888035,
72
+ "6hH1j3" => 3470848414,
73
+ "6hNP1u" => 3471981064,
74
+ "6hFWge" => 3470639683,
75
+ "6hFpmP" => 3470535723,
76
+ "6hCgQZ" => 3469925109,
77
+ "6hFJSm" => 3470601352,
78
+ "6hEd9v" => 3470302893,
79
+ "6hDwuF" => 3470169503,
80
+ "6hCVSX" => 3470053055,
81
+ "6hCUgr" => 3470047631,
82
+ "6hEsqR" => 3470350937,
83
+ "6hBmKg" => 3469746485,
84
+ "6hDvUx" => 3470167523,
85
+ "6hJUi7" => 3471218400,
86
+ "6hF39e" => 3470464349,
87
+ "6hH43K" => 3470857619,
88
+ "6hGSC5" => 3470822548,
89
+ "6hFz1s" => 3470568182,
90
+ "6hFaKZ" => 3470489971,
91
+ "6hD65K" => 3470084015,
92
+ "6hBAVk" => 3469794165,
93
+ "6hLkWA" => 3471499786,
94
+ "6hHi7q" => 3470904928,
95
+ "6hHdDF" => 3470889921,
96
+ "6hHcCo" => 3470886482,
97
+ "6hGQQf" => 3470816526,
98
+ "6hLAfo" => 3471547914,
99
+ "6hBDEV" => 3469803421,
100
+ "6hL4BE" => 3471444864,
101
+ "6hL2TT" => 3471439077,
102
+ "6hKcxb" => 3471276404,
103
+ "6hD1vg" => 3470068617,
104
+ "6hLtTT" => 3471526541,
105
+ "6hHXtw" => 3471033984,
106
+ "6hHCQj" => 3470971274,
107
+ "6hFrXx" => 3470544465,
108
+ "6hMVkJ" => 3471807252,
109
+ "6hDv6V" => 3470164819,
110
+ "6hD1gR" => 3470067839,
111
+ "6hShWW" => 3472660386,
112
+ "6hK4tb" => 3471249260,
113
+ "6hLzrQ" => 3471545214,
114
+ "6hBTAe" => 3469850245,
115
+ "6hLABq" => 3471549134,
116
+ "6hGbN7" => 3470688570,
117
+ "6hFtro" => 3470549444,
118
+ "6hRRAQ" => 3472575120,
119
+ "6hFViL" => 3470636466,
120
+ "6hFkLP" => 3470523659,
121
+ "6hNAKc" => 3471939809,
122
+ "6hLLNE" => 3471583426,
123
+ "6hJstp" => 3471131533,
124
+ "6hHxv3" => 3470953336,
125
+ "6hLToQ" => 3471605592,
126
+ "6hJ74F" => 3471062877,
127
+ "6hGjCA" => 3470714930,
128
+ "6hCQoD" => 3470034593,
129
+ "6hCqxX" => 3469954397,
130
+ "6hCbg8" => 3469906325,
131
+ "6hJwGw" => 3471145750,
132
+ "6hP2Tt" => 3472024389,
133
+ "6hHDuy" => 3470973492,
134
+ "6hGRpq" => 3470818450,
135
+ "6hDx8F" => 3470171649,
136
+ "6hLhxU" => 3471488378,
137
+ "6hFrkd" => 3470542358,
138
+ "6hPc3D" => 3472055197,
139
+ "6hJV29" => 3471220838,
140
+ "6hCc3c" => 3469908939,
141
+ "6hLycA" => 3471541024,
142
+ "6hLd75" => 3471473424,
143
+ "6hKJ1m" => 3471378900,
144
+ "6hHgEG" => 3470900072,
145
+ "6hFNfm" => 3470612720,
146
+ "6hFsaF" => 3470545169,
147
+ "6hERqV" => 3470428313,
148
+ "6hEnYK" => 3470335967,
149
+ "6hDGeT" => 3470202285,
150
+ "6hFDZo" => 3470584940,
151
+ "6hMvPE" => 3471728136,
152
+ "6hKTro" => 3471410628,
153
+ "6hKfXG" => 3471287918,
154
+ "6hKeuU" => 3471283000,
155
+ "6hHFYj" => 3470981830,
156
+ "6hHDzj" => 3470973768,
157
+ "6hCozt" => 3469947757,
158
+ "6hKB8D" => 3471355775,
159
+ "6hCtrc" => 3469964097,
160
+ "6hDXcx" => 3470252609,
161
+ "6hCxSR" => 3469979041,
162
+ "6hC1Vk" => 3469874901,
163
+ "6hKmaS" => 3471305444,
164
+ "6hK9fn" => 3471265337,
165
+ "6hFDH6" => 3470583995,
166
+ "6hEB7c" => 3470380131,
167
+ "6hC1E2" => 3469874013,
168
+ "6hBZnx" => 3469869693,
169
+ "6hBXNz" => 3469864417,
170
+ "6hQKjm" => 3472358868,
171
+ "6hHn4j" => 3470918204,
172
+ "6hHiQ2" => 3470907341,
173
+ "6hHhHb" => 3470903580,
174
+ "6hGnBc" => 3470724941,
175
+ "6hG6Ht" => 3470671481,
176
+ "6hDvh6" => 3470165409,
177
+ "6hCGtp" => 3470007957,
178
+ "6hCnzi" => 3469944383,
179
+ "6hMxEY" => 3471734360,
180
+ "6hG9sL" => 3470680720,
181
+ "6hCarn" => 3469903555,
182
+ "6hLsdE" => 3471520902,
183
+ "6hKnDa" => 3471310391,
184
+ "6hKn2L" => 3471308338,
185
+ "6hGpfH" => 3470730481,
186
+ "6hRkJS" => 3472474666,
187
+ "6hFEV3" => 3470588052,
188
+ "6hE7VV" => 3470285343,
189
+ "6hSSAq" => 3472773572,
190
+ "6hNTtQ" => 3471996106,
191
+ "6hMAuK" => 3471743859,
192
+ "6hJ95H" => 3471069665,
193
+ "6hHZ39" => 3471039240,
194
+ "6hByNi" => 3469787029,
195
+ "6hLLnb" => 3471581948,
196
+ "6hHYoQ" => 3471037076,
197
+ "6hHCLm" => 3470971044,
198
+ "6hFHkC" => 3470596206,
199
+ "6hDKq4" => 3470212967,
200
+ "6hRapC" => 3472439910,
201
+ "6hKJBs" => 3471380936,
202
+ "6hHids" => 3470905278,
203
+ "6hEJ8R" => 3470403775,
204
+ "6hMY3L" => 3471816360,
205
+ "6hFRAC" => 3470623988,
206
+ "6hEP9c" => 3470420615,
207
+ "6hEqVR" => 3470345891,
208
+ "6hHGBX" => 3470984013,
209
+ "6hEzFB" => 3470375341,
210
+ "6hDnRp" => 3470140429,
211
+ "6hDdQH" => 3470110113,
212
+ "6hCK7B" => 3470016843,
213
+ "6hCxvH" => 3469977815,
214
+ "6hC4v4" => 3469883585,
215
+ "6hC15g" => 3469872055,
216
+ "6hGHRA" => 3470793056,
217
+ "6hGCGL" => 3470775724,
218
+ "6hGbuW" => 3470687574,
219
+ "6hT7FY" => 3472820990,
220
+ "6hMFHs" => 3471761416,
221
+ "6hJybH" => 3471150749,
222
+ "6hGEFs" => 3470782376,
223
+ "6hCBnX" => 3469990821,
224
+ "6hNJZt" => 3471967549,
225
+ "6hMxUV" => 3471735169,
226
+ "6hLoGG" => 3471509072,
227
+ "6hJdy5" => 3471084708,
228
+ "6hGnwp" => 3470724663,
229
+ "6hGkhZ" => 3470717157,
230
+ "6hG7yd" => 3470674308,
231
+ "6hDAqF" => 3470182727,
232
+ "6hPQVJ" => 3472182628,
233
+ "6hHyqy" => 3470956440,
234
+ "6hFG6k" => 3470592013,
235
+ "6hTavC" => 3472830482,
236
+ "6hJjzU" => 3471104998,
237
+ "6hFE7r" => 3470585349,
238
+ "6hNQU7" => 3471987422,
239
+ "6hJYSj" => 3471233782,
240
+ "6hFVRB" => 3470638313,
241
+ "6hEeQt" => 3470308575,
242
+ "6hBmnK" => 3469745237,
243
+ "6hP9VU" => 3472048078,
244
+ "6hJeDp" => 3471088381,
245
+ "6hHV4d" => 3471025846,
246
+ "6hFXmS" => 3470643374,
247
+ "6hBgEn" => 3469729381,
248
+ "6hNDjB" => 3471948475,
249
+ "6hKEkd" => 3471366538,
250
+ "6hJDq6" => 3471168345,
251
+ "6hHbCG" => 3470883136,
252
+ "6hCgN2" => 3469924937,
253
+ "6hQa3S" => 3472243594,
254
+ "6hLphv" => 3471511033,
255
+ "6hHoqd" => 3470922780,
256
+ "6hGT2W" => 3470823932,
257
+ "6hEd6V" => 3470302743,
258
+ "6hNac3" => 3471853844,
259
+ "6hHzYe" => 3470961641,
260
+ "6hRDAC" => 3472534740,
261
+ "6hJ2bu" => 3471046452,
262
+ "6hGRPN" => 3470819864,
263
+ "6hFS6P" => 3470625681,
264
+ "6hG8Yn" => 3470679073,
265
+ "6hFSGB" => 3470627699,
266
+ "6hFQhL" => 3470619588,
267
+ "6hF4VT" => 3470470361,
268
+ "6hE7vD" => 3470283935,
269
+ "6hBeKa" => 3469722931,
270
+ "6hPLs1" => 3472167564,
271
+ "6hHcKm" => 3470886886,
272
+ "6hG9KW" => 3470681716,
273
+ "6hE8E4" => 3470287787,
274
+ "6hNp1U" => 3471900352,
275
+ "6hJ29T" => 3471046359,
276
+ "6hHPLb" => 3471008038,
277
+ "6hGWGq" => 3470836256,
278
+ "6hEipV" => 3470320607,
279
+ "6hMB8U" => 3471746014,
280
+ "6hKWyr" => 3471421129,
281
+ "6hKLxb" => 3471387416,
282
+ "6hJstE" => 3471131548,
283
+ "6hHk3k" => 3470911419,
284
+ "6hPSdE" => 3472186974,
285
+ "6hPfEY" => 3472067396,
286
+ "6hGVSS" => 3470833498,
287
+ "6hFVX4" => 3470638629,
288
+ "6hFQRa" => 3470621467,
289
+ "6hCsKK" => 3469961809,
290
+ "6hJbdY" => 3471076872,
291
+ "6hE2ok" => 3470266691,
292
+ "6hCrc8" => 3469956553,
293
+ "6hRgwS" => 3472460514,
294
+ "6hPhLY" => 3472074472,
295
+ "6hLTK1" => 3471606762,
296
+ "6hHh5u" => 3470901452,
297
+ "6hDiBB" => 3470126173,
298
+ "6hD678" => 3470084095,
299
+ "6hKMXC" => 3471392198,
300
+ "6hBohi" => 3469751649,
301
+ "6hJXRV" => 3471230395,
302
+ "6hFzad" => 3470568690,
303
+ "6hCCbH" => 3469993533,
304
+ "6hLpoA" => 3471511386,
305
+ "6hKZQN" => 3471432170,
306
+ "6hG3Ax" => 3470660987,
307
+ "6hT7kf" => 3472819788,
308
+ "6hKrzq" => 3471323630,
309
+ "6hHMHM" => 3471001171,
310
+ "6hHL9q" => 3470995872,
311
+ "6hBUkR" => 3469852775,
312
+ "6hRRLf" => 3472575666,
313
+ "6hJFUg" => 3471176707,
314
+ "6hBML2" => 3469830629,
315
+ "6hS9eE" => 3472631080,
316
+ "6hPD3o" => 3472142646,
317
+ "6hKWhL" => 3471420220,
318
+ "6hJMpr" => 3471195219,
319
+ "6hHzVA" => 3470961488,
320
+ "6hGvu9" => 3470751444,
321
+ "6hGkTu" => 3470719158,
322
+ "6hF7bv" => 3470477937,
323
+ "6hDzQp" => 3470180739,
324
+ "6hQ2Mo" => 3472219148,
325
+ "6hM7Tn" => 3471650979,
326
+ "6hJWDp" => 3471226305,
327
+ "6hJpX5" => 3471123046,
328
+ "6hNLTn" => 3471973923,
329
+ "6hGuRu" => 3470749318,
330
+ "6hG1CM" => 3470654389,
331
+ "6hEMDx" => 3470415589,
332
+ "6hCYpx" => 3470061557,
333
+ "6hCSTr" => 3470042991,
334
+ "6hBnJr" => 3469749801,
335
+ "6hRZSh" => 3472602928,
336
+ "6hRtVW" => 3472502220,
337
+ "6hDzc2" => 3470178571,
338
+ "6hCMan" => 3470023731,
339
+ "6hRfUj" => 3472458394,
340
+ "6hLdME" => 3471475720,
341
+ "6hE69P" => 3470279363,
342
+ "6hDgaa" => 3470117911,
343
+ "6hDeKg" => 3470113161,
344
+ "6hKSis" => 3471406804,
345
+ "6hKwYj" => 3471341778,
346
+ "6hJ4Ro" => 3471055436,
347
+ "6hHTug" => 3471020571,
348
+ "6hHSH2" => 3471017947,
349
+ "6hHCE6" => 3470970681,
350
+ "6hG5R5" => 3470668558,
351
+ "6hFaBX" => 3470489505,
352
+ "6hL13o" => 3471432842,
353
+ "6hJtQr" => 3471136117,
354
+ "6hHpg3" => 3470925612,
355
+ "6hGinv" => 3470710691,
356
+ "6hFQXR" => 3470621855,
357
+ "6hCKN6" => 3470019133,
358
+ "6hJme9" => 3471110522,
359
+ "6hGUY8" => 3470830439,
360
+ "6hEDPM" => 3470389271,
361
+ "6hBg1c" => 3469727167,
362
+ "6hNyoj" => 3471931870,
363
+ "6hNdQu" => 3471866108,
364
+ "6hMNAK" => 3471784575,
365
+ "6hHkvV" => 3470913019,
366
+ "6hDHLi" => 3470207413,
367
+ "6hCwUk" => 3469975763,
368
+ "6hCd2a" => 3469912243,
369
+ "6hPeRd" => 3472064626,
370
+ "6hP4SL" => 3472031076,
371
+ "6hJQFC" => 3471206250,
372
+ "6hJLVJ" => 3471193612,
373
+ "6hJAJT" => 3471159343,
374
+ "6hJ8Mi" => 3471068655,
375
+ "6hJ6o5" => 3471060580,
376
+ "6hH667" => 3470864484,
377
+ "6hH5RU" => 3470863718,
378
+ "6hC2jx" => 3469876247,
379
+ "6hPm75" => 3472085672,
380
+ "6hN8ud" => 3471848112,
381
+ "6hLD4g" => 3471557361,
382
+ "6hGAr2" => 3470768083,
383
+ "6hFVQH" => 3470638261,
384
+ "6hDxtV" => 3470172823,
385
+ "6hPNwj" => 3472174542,
386
+ "6hKTB7" => 3471411192,
387
+ "6hJdfQ" => 3471083708,
388
+ "6hRvdq" => 3472506540,
389
+ "6hNpN9" => 3471902976,
390
+ "6hMd75" => 3471668536,
391
+ "6hLkks" => 3471497748,
392
+ "6hHkYn" => 3470914553,
393
+ "6hGZgY" => 3470844930,
394
+ "6hGorv" => 3470727743,
395
+ "6hG941" => 3470679342,
396
+ "6hC6xK" => 3469890469,
397
+ "6hTA5N" => 3472913142,
398
+ "6hNzGE" => 3471936298,
399
+ "6hN3F1" => 3471831918,
400
+ "6hLdgN" => 3471473988,
401
+ "6hFyvS" => 3470566524,
402
+ "6hCxUM" => 3469979153,
403
+ "6hCmje" => 3469940145,
404
+ "6hC87z" => 3469895737,
405
+ "6hC4mV" => 3469883113,
406
+ "6hQXaJ" => 3472398736,
407
+ "6hP6Tw" => 3472037848,
408
+ "6hLx7r" => 3471537361,
409
+ "6hFvYh" => 3470557964,
410
+ "6hEPWM" => 3470423317,
411
+ "6hDKDT" => 3470213769,
412
+ "6hBrcn" => 3469761455,
413
+ "6hBkh4" => 3469741543,
414
+ "6hMdbq" => 3471668788,
415
+ "6hK3cE" => 3471244996,
416
+ "6hJSUj" => 3471213714,
417
+ "6hJvFs" => 3471142324,
418
+ "6hHVMu" => 3471028298,
419
+ "6hHUZG" => 3471025642,
420
+ "6hHeVT" => 3470894225,
421
+ "6hFqjr" => 3470538949,
422
+ "6hETNt" => 3470436291,
423
+ "6hEPkX" => 3470421297,
424
+ "6hCVrB" => 3470051585,
425
+ "6hCE2V" => 3469999751,
426
+ "6hNe3j" => 3471866794,
427
+ "6hKjmA" => 3471299338,
428
+ "6hHbMp" => 3470883641,
429
+ "6hGWJ7" => 3470836354,
430
+ "6hGn3F" => 3470723055,
431
+ "6hFoKL" => 3470533690,
432
+ "6hETWx" => 3470436759,
433
+ "6hPaH5" => 3472050698,
434
+ "6hNFFf" => 3471956400,
435
+ "6hNnyp" => 3471895451,
436
+ "6hM7ra" => 3471649459,
437
+ "6hHof7" => 3470922194,
438
+ "6hH8KM" => 3470873455,
439
+ "6hGbCG" => 3470688024,
440
+ "6hDXaB" => 3470252497,
441
+ "6hDSF2" => 3470237383,
442
+ "6hDfq8" => 3470115415,
443
+ "6hCqqR" => 3469953985,
444
+ "6hPpj7" => 3472096462,
445
+ "6hMSHG" => 3471798434,
446
+ "6hKyF6" => 3471347507,
447
+ "6hK33v" => 3471244465,
448
+ "6hJwva" => 3471145091,
449
+ "6hGX9e" => 3470837753,
450
+ "6hFWeR" => 3470639603,
451
+ "6hD8oF" => 3470091783,
452
+ "6hCopg" => 3469947165,
453
+ "6hC9L8" => 3469901279,
454
+ "6hBhS4" => 3469733423,
455
+ "6hMQXy" => 3471792510,
456
+ "6hLoRU" => 3471509606,
457
+ "6hKCib" => 3471359692,
458
+ "6hKder" => 3471278739,
459
+ "6hHYPy" => 3471038510,
460
+ "6hD4hz" => 3470077973,
461
+ "6hPgTS" => 3472071508,
462
+ "6hNXii" => 3472008951,
463
+ "6hKYzE" => 3471427928,
464
+ "6hKSr2" => 3471407243,
465
+ "6hG4fB" => 3470663195,
466
+ "6hFyz2" => 3470566707,
467
+ "6hFoMT" => 3470533813,
468
+ "6hC5V4" => 3469888341,
469
+ "6hBZmZ" => 3469869661,
470
+ "6hPXKU" => 3472205606,
471
+ "6hHVwm" => 3471027420,
472
+ "6hCzFH" => 3469985123,
473
+ "6hCvsM" => 3469970917,
474
+ "6hChKr" => 3469928151,
475
+ "6hBv6F" => 3469774581,
476
+ "6hPf62" => 3472065427,
477
+ "6hNS4s" => 3471991328,
478
+ "6hNPXe" => 3471984239,
479
+ "6hLguh" => 3471484804,
480
+ "6hJ5zB" => 3471057885,
481
+ "6hHr6j" => 3470931776,
482
+ "6hLBUx" => 3471553491,
483
+ "6hLi1P" => 3471489939,
484
+ "6hKQ35" => 3471399184,
485
+ "6hKK67" => 3471382540,
486
+ "6hHUcT" => 3471022985,
487
+ "6hGPjm" => 3470811428,
488
+ "6hF5ti" => 3470472183,
489
+ "6hDZPz" => 3470261427,
490
+ "6hC17D" => 3469872193,
491
+ "6hR7R3" => 3472431292,
492
+ "6hN7hS" => 3471844090,
493
+ "6hHqoC" => 3470929416,
494
+ "6hFDdx" => 3470582339,
495
+ "6hFzdL" => 3470568896,
496
+ "6hDuEH" => 3470163357,
497
+ "6hCaZk" => 3469905409,
498
+ "6hT2Hw" => 3472804260,
499
+ "6hPhJY" => 3472074356,
500
+ "6hKNBy" => 3471394398,
501
+ "6hJPEq" => 3471202816,
502
+ "6hGMH7" => 3470806020,
503
+ "6hGp5L" => 3470729904,
504
+ "6hFfRV" => 3470507135,
505
+ "6hESHt" => 3470432637 }
506
+
507
+ def test_int_to_base58
508
+ EXAMPLES.each do |expected, integer|
509
+ assert_equal expected, Base58.int_to_base58(integer)
510
+ end
511
+ end
512
+
513
+ def test_base58_to_int
514
+ EXAMPLES.each do |base_58, expected|
515
+ assert_equal expected, Base58.base58_to_int(base_58)
516
+ end
517
+ end
518
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: base58
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Douglas F Shearer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-11-05 00:00:00 +00:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Base58 is a Ruby library for converting ints to and from base58.
17
+ email: dougal.s@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.rdoc
24
+ files:
25
+ - .gitignore
26
+ - CHANGELOG
27
+ - MIT-LICENSE
28
+ - README.rdoc
29
+ - Rakefile
30
+ - VERSION
31
+ - base58.gemspec
32
+ - lib/base58.rb
33
+ - test/test_base58.rb
34
+ has_rdoc: true
35
+ homepage: http://github.com/dougal/base58
36
+ licenses: []
37
+
38
+ post_install_message:
39
+ rdoc_options:
40
+ - --charset=UTF-8
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: "0"
48
+ version:
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ requirements: []
56
+
57
+ rubyforge_project:
58
+ rubygems_version: 1.3.5
59
+ signing_key:
60
+ specification_version: 3
61
+ summary: Base58 is a Ruby library for converting ints to and from base58.
62
+ test_files:
63
+ - test/test_base58.rb