base58_gmp 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
1
+ require 'test/unit'
2
+ require 'base58_gmp'
3
+
4
+ class TestBase58GMP < Test::Unit::TestCase
5
+
6
+ ALPHABETS = {
7
+ '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv' =>
8
+ '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
9
+ }
10
+
11
+ def test_flickr_gmp_transcoding
12
+ ALPHABETS.each do |gmp, flickr|
13
+ assert_equal gmp, Base58GMP.flickr_to_gmp(flickr)
14
+ assert_equal flickr, Base58GMP.gmp_to_flickr(gmp)
15
+ end
16
+ end
17
+
18
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base58_gmp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Wang
@@ -36,7 +36,8 @@ files:
36
36
  - base58_gmp.gemspec
37
37
  - lib/base58_gmp.rb
38
38
  - test/test_base58_gmp.rb
39
- - test/test_md5_base58.rb
39
+ - test/test_encode-decode-multi.rb
40
+ - test/test_flickr-gmp.rb
40
41
  has_rdoc: true
41
42
  homepage: http://rubygems.org/gems/base58_gmp
42
43
  licenses: []
@@ -1,190 +0,0 @@
1
- require 'test/unit'
2
- require 'base58_gmp'
3
-
4
- class TestBase58GMP < Test::Unit::TestCase
5
-
6
- MD5_EXAMPLES = {
7
- 'adam@t1.foobar.com' => 'cLyvfgxMmJ4imn6MwxfEzb',
8
- 'alexander@t2.foobar.com' => 'gCWkLkBYTJYgudgBCLPME4',
9
- 'alice@t3.foobar.com' => 'jbvgmJ6M2f6yqG7BZjyG3V',
10
- 'andrew@t4.foobar.com' => 'doB64s8kjip3PpUXfPN5DT',
11
- 'anna@t5.foobar.com' => '52Aa4kRyEQYYngM2ejsgUG',
12
- 'annabel@t6.foobar.com' => 'uvFiDuVaBvRPZmpeMgfFZc',
13
- 'anne@t7.foobar.com' => 'p2ixWDwJhR4rLk5Qp8vG3K',
14
- 'anthony@t8.foobar.com' => 'cVTPsTPL3XGVGNfguAkKi9',
15
- 'arthur@t9.foobar.com' => 's7MmQ3J7kJdmhs6Dh2iqe5',
16
- 'asher@t10.foobar.com' => '3AQfYjm3ereVCbk6UiiDpm',
17
- 'atticus@t11.foobar.com' => '9uNQDKegGRFxssber7iLyd',
18
- 'august@t12.foobar.com' => 'opKe6gZux8XrkripZoDKvr',
19
- 'beatrice@t13.foobar.com' => '47ZoJMfkKPjevMifcE9GMq',
20
- 'benjamin@t14.foobar.com' => 'd6nUszRtqn8ZD7ri3AokAP',
21
- 'butch@t15.foobar.com' => 'm3DKJwLfHtgm1rGuSgs23s',
22
- 'caroline@t16.foobar.com' => '8WbKULXo6kwtsHDCHMRDn3',
23
- 'charles@t17.foobar.com' => 'p6kBDZhrBNCwQUDyMWAu3J',
24
- 'charlotte@t18.foobar.com' => '9zKZCLPy2ZM8VRxSY8eHh7',
25
- 'christopher@t19.foobar.com' => '89Zx7mhbQmGektaWbLTD83',
26
- 'claire@t20.foobar.com' => 'jerxFmdFLZdiPTbtAE4RRW',
27
- 'clementine@t21.foobar.com' => '49mAPwbkPzywjJDjH8fkji',
28
- 'daisy@t22.foobar.com' => 'oTcUfyaptjpspnRjisQV4d',
29
- 'daniel@t23.foobar.com' => 'e5erPbsJTQRZJ21QAzkM3v',
30
- 'dashiell@t24.foobar.com' => 'fU7jgzihYccLdbRkD4p4Dw',
31
- 'david@t25.foobar.com' => '3gsB9Mcw1KEcX7rnfxCVWs',
32
- 'delilah@t26.foobar.com' => 'czpj88sMnUqkcnCF8VjFnt',
33
- 'dexter@t27.foobar.com' => 'j4Q5Dtq6s37yzRZhbS5YC9',
34
- 'diana@t28.foobar.com' => '4agRLH5d8g8fwvfBAvNHU9',
35
- 'dixie@t29.foobar.com' => 'gPaJj7frXSX7m25PRnA8MQ',
36
- 'duke@t30.foobar.com' => '7EUdabgtAcHwsj8AecAifR',
37
- 'edie@t31.foobar.com' => '839e6nYnuoKeBA2fcFfjuk',
38
- 'edith@t32.foobar.com' => 'x5eCBLpMNnkVfdV2hewRZQ',
39
- 'edward@t33.foobar.com' => 'xoXUn5zuPWKmDbPKnyHmh6',
40
- 'eleanor@t34.foobar.com' => 'jPuNbfoin3kby2MDCd9yUd',
41
- 'eliza@t35.foobar.com' => 'tpJVYe8ndsSdQDDXK6RcbD',
42
- 'elizabeth@t36.foobar.com' => 'd9JhheywJsX4cdbHHxvE1D',
43
- 'ella@t37.foobar.com' => 'wmnv7JjFZXTBdeto9UK51K',
44
- 'elvis@t38.foobar.com' => '22UQqi4yQMptXqPQFRWA3m',
45
- 'emily@t39.foobar.com' => '99JVBHbh4yGMah1iuzYW6',
46
- 'emma@t40.foobar.com' => 'iPTaT5CfzCkFZyhZn8ZCzM',
47
- 'eve@t41.foobar.com' => '4vtKxUhbUeVg2V23s97mnL',
48
- 'faith@t42.foobar.com' => 'r6oLUF5wZA7LFvXuNibGc1',
49
- 'flora@t43.foobar.com' => 'x6iZQGGyxJAisWwHt8x2ek',
50
- 'florence@t44.foobar.com' => 'q42bQccuA357rAepcvYjCc',
51
- 'frances@t45.foobar.com' => 'srDUk7emsidGNjbLFuYnfK',
52
- 'francis@t46.foobar.com' => 'rW8R8bZXJwhhCEYKQCpbPN',
53
- 'frank@t47.foobar.com' => 'iDcHArkcoxVyHhCgRruMZW',
54
- 'frederick@t48.foobar.com' => 'iEBvmYEvswcsZNpbEJzk7C',
55
- 'george@t49.foobar.com' => '6kDLTgBZmTdfUrKEsexM1b',
56
- 'georgia@t50.foobar.com' => 'a55XavuUnj6Uozu7gPCsLG',
57
- 'grace@t51.foobar.com' => 'rnXNjudUh8iU1cFanSmcYr',
58
- 'gus@t52.foobar.com' => '7aDMJbxRPaaNvKccwX4E8k',
59
- 'harper@t53.foobar.com' => 'vZ4AV7onL2p5LRcfUDVuiq',
60
- 'harry@t54.foobar.com' => 'az4wXc5RbGtqPVudFwxue6',
61
- 'hazel@t55.foobar.com' => 'a1PDVgXfvzj7et4uNajZ6R',
62
- 'helen@t56.foobar.com' => '21wYy23x9FrFSVTEK5tgM2',
63
- 'henry@t57.foobar.com' => 'qQu8GQuD73WamRfkZ97XCx',
64
- 'homer@t58.foobar.com' => 'jpVQDxWQk91cAdiEMYfibY',
65
- 'hopper@t59.foobar.com' => '5Hcu7XohWve1GDMc5v44Tm',
66
- 'hudson@t60.foobar.com' => '9cGj3mSi8mDP2QLnqXScFC',
67
- 'hugh@t61.foobar.com' => 'pptG5q3SGUui2uwGGpcpAE',
68
- 'hugo@t62.foobar.com' => 'kY5JTDDXRL8MtZrP4BqjuN',
69
- 'ike@t63.foobar.com' => 'sxsMu3s9XDwzEH5ZSUxvbP',
70
- 'india@t64.foobar.com' => 't2Rzr9QNoXwEYr18P9QGft',
71
- 'ione@t65.foobar.com' => 'uLeGJWFRpRWwzLbbCHrs3w',
72
- 'irene@t66.foobar.com' => 'oV4fFctoDETxRNhyzpsLig',
73
- 'iris@t67.foobar.com' => 'q3mKKPV83BrL6Ed7N4tQfB',
74
- 'isla@t68.foobar.com' => 'iSG8o3GpnfFxqxRd3NcJeu',
75
- 'ivy@t69.foobar.com' => 'cQttt28wtoq3jcGB1zBLVA',
76
- 'jack@t70.foobar.com' => 'wxArA8fKvrFgz7W7JpMD9u',
77
- 'jacob@t71.foobar.com' => 'bivemVTZPiBZQ38ZzqWrAC',
78
- 'james@t72.foobar.com' => 'hNJPaGPKT1YmEHyBkmMsWd',
79
- 'jane@t73.foobar.com' => 'mpEHWdfJfvTfbqJedP9ZqE',
80
- 'jean@t74.foobar.com' => 'kkY69EJdQohctAsJQMvmuE',
81
- 'jill@t75.foobar.com' => '5URSdHeFGbtZ7Z35GpUPgB',
82
- 'john@t76.foobar.com' => '9FtjroUqSCHb2RCGyBqjAT',
83
- 'jonathan@t77.foobar.com' => '8nHqePr6kErsi8oHtAceLU',
84
- 'joseph@t78.foobar.com' => 'kyzmfyyPzCZMeaGnST2Bf2',
85
- 'judith@t79.foobar.com' => '9r5SHvk4vbxNsahcZ6i2BM',
86
- 'julia@t80.foobar.com' => 'mkbZ6sbrx3s5DLceRUhqnX',
87
- 'julian@t81.foobar.com' => 'xwao2JiMxHxQbybEMxHUx4',
88
- 'june@t82.foobar.com' => '2AJRk8P3JCjRnV2SBhptEg',
89
- 'kai@t83.foobar.com' => 'qF9STnT3WN9Z5qzSfY85sd',
90
- 'kate@t84.foobar.com' => 'uxQaYE2WWsQi1YnNWR5xKF',
91
- 'katherine@t85.foobar.com' => 'vcNFyUwtsKgbHtG3zG98Zq',
92
- 'kingston@t86.foobar.com' => 'oLvodypvWHCM11xd5xUJGe',
93
- 'laura@t87.foobar.com' => 'wj48zQvxTCR9aLk63qV4Kw',
94
- 'lennon@t88.foobar.com' => 'ePKh1xSQpgsiz8v8gdACqc',
95
- 'leo@t89.foobar.com' => 'cHyotGtfcJnU7VCbJUBecG',
96
- 'leonora@t90.foobar.com' => 'g3HEhnT2xUSqqSQdbnBdZT',
97
- 'leopold@t91.foobar.com' => 'oJZSBpt8jrai34aqmG49ig',
98
- 'levi@t92.foobar.com' => 'vJKcfBSHnwpwZ6g9H29UV9',
99
- 'lila@t93.foobar.com' => 'c4gm3ivHspRg9Rj6U11a5',
100
- 'lionel@t94.foobar.com' => 'rSeNeb5CwYajNAb8yLrNcp',
101
- 'lola@t95.foobar.com' => 'bnkNUMarkMh3TDRtJgBNJE',
102
- 'louis@t96.foobar.com' => 'ku1kVEn1Y2hjmTJ3KamydJ',
103
- 'louisa@t97.foobar.com' => 'fBQRiZhJLVUxPpwHVjt6qV',
104
- 'luca@t98.foobar.com' => 'h9d74J1GYGZ7F9jvJob1ua',
105
- 'lucy@t99.foobar.com' => '3JAMMqpzhUL1cx9gLAZtAt',
106
- 'luke@t100.foobar.com' => '78fqBQFx8EBRHhiQdNJvEr',
107
- 'lulu@t101.foobar.com' => '4Lt6GFG8KwtKDFXxT9ZKZk',
108
- 'madeline@t102.foobar.com' => 'x1t6CDsqgVFaYQ8t7c1x3r',
109
- 'magnus@t103.foobar.com' => 'jyUa5mGS5qqLWKqdyM2j7M',
110
- 'mamie@t104.foobar.com' => 'gon7gmCvbkL1zbyfnU8zki',
111
- 'margaret@t105.foobar.com' => 'pCtYEFcXX2ccwAnEy9ypzX',
112
- 'maria@t106.foobar.com' => 'vEE2nbqjWK31Mymb5J7JVV',
113
- 'marian@t107.foobar.com' => 'oHmtco8KggGsgky3ViPu9h',
114
- 'mark@t108.foobar.com' => 'rc5LpJLg4UwdzgxqugrDuq',
115
- 'martha@t109.foobar.com' => 'ruTREKhJqfm1t6yLGM9w17',
116
- 'martin@t110.foobar.com' => 'e6H2s8W6bTksoVCN86oYGT',
117
- 'mary@t111.foobar.com' => 'aQjwtP33evg7HJeoV9NuQ8',
118
- 'matilda@t112.foobar.com' => 'pP9mqi9ZCqaBJQf5BP5zHu',
119
- 'matthew@t113.foobar.com' => 'iPa4rqs6XBEHXCjjNwfM8X',
120
- 'michael@t114.foobar.com' => 'o5v95kkqNSty5naX3RMnc4',
121
- 'millie@t115.foobar.com' => '6uDWP8ieVow3TMZwNfNAXM',
122
- 'milo@t116.foobar.com' => '7zFWBQK4DLjR6xKCyZfkfb',
123
- 'minnie@t117.foobar.com' => 'eNJD4n4vii5YWpR4zdaJeV',
124
- 'moses@t118.foobar.com' => 'rxR5gbUKw3paMpUwtQ1sQA',
125
- 'nathan@t119.foobar.com' => 'foGEysvSy36aiXbqwSw8zp',
126
- 'nathaniel@t120.foobar.com' => '5yoDz6zDST9F3yKyUKKHcN',
127
- 'nicholas@t121.foobar.com' => '37xHbT6Tzd9KcpPVYQNueA',
128
- 'olive@t122.foobar.com' => 'wmyGY8fyaLBg9QXy46mT7R',
129
- 'olivia@t123.foobar.com' => 'rR9J61gvnvoL7gPPMSSUnF',
130
- 'orson@t124.foobar.com' => 'pYUvs2RzKhJ98mtSWCgdcA',
131
- 'oscar@t125.foobar.com' => '78znFsuexcTXmP7PxwyE6R',
132
- 'otis@t126.foobar.com' => '2Q8pdN9AmWg8xi2gp6S1mu',
133
- 'pamela@t127.foobar.com' => 'ij9ddEeBWXc8NrjzoxqeeU',
134
- 'patricia@t128.foobar.com' => 'sVBFufZC7vbVAra9ZNprvd',
135
- 'patrick@t129.foobar.com' => '9xLQ7fv3erkjBv6QEa9Ppy',
136
- 'paul@t130.foobar.com' => '92v4ieSoNv5KAWwqDQaLuv',
137
- 'pearl@t131.foobar.com' => 'sMtVHCfgoGsXcFL8P2gEv4',
138
- 'peter@t132.foobar.com' => 'aiDSCwedfswZBEk3p93gg4',
139
- 'philip@t133.foobar.com' => 'uM6TUDWqaFV8R5htKkpirw',
140
- 'piper@t134.foobar.com' => 'gPXui9N46dUHj1BuZeuySk',
141
- 'poppy@t135.foobar.com' => '9oTgGP72muLRPePw86E7yU',
142
- 'rachel@t136.foobar.com' => 'pbSWqcABLnLtYhS6kQPcSP',
143
- 'ray@t137.foobar.com' => '95eyDfggw9Cw5dwWwbpo58',
144
- 'raymond@t138.foobar.com' => '6oJHke65wVydRwbmYnWtKD',
145
- 'rebecca@t139.foobar.com' => 'qRjaoGKpyGT6SybfEH7wrJ',
146
- 'richard@t140.foobar.com' => 'fsXYuV8CYEAqix9P8F9KtS',
147
- 'robert@t141.foobar.com' => 'nWzK2fnDPjs2GFX145e3U1',
148
- 'roman@t142.foobar.com' => '8pF4mTEVEfEfSNFj4bt635',
149
- 'romy@t143.foobar.com' => 'bz8Lfj6eSJZZ8PsCqzgiwd',
150
- 'roscoe@t144.foobar.com' => 'g4Y22G4JMh5Mp6CWrahtLB',
151
- 'rose@t145.foobar.com' => '9vEznJvECTphuW57y3shkk',
152
- 'ruby@t146.foobar.com' => 'qvdSAt8t8JfoeM1CvoyvZH',
153
- 'rufus@t147.foobar.com' => 'fJ3hyQ76sX6QhjJQnxNoyH',
154
- 'ruth@t148.foobar.com' => 'semaD6BpBCt2TEHes9FY13',
155
- 'sadie@t149.foobar.com' => 'UdfW5bmddDGjpFt1sZzk4',
156
- 'sally@t150.foobar.com' => 'eC6eFrxbYxSe8hzLN4aLRu',
157
- 'samuel@t151.foobar.com' => 'cyBSm8hBKFDmxS6RTgyxTj',
158
- 'sarah@t152.foobar.com' => 'gEvas2eVntU1vMTLAc22ho',
159
- 'scarlett@t153.foobar.com' => 'iHE5KNGu64ma8r9VHJAmaQ',
160
- 'sebastian@t154.foobar.com' => 'bmymJQ3P3Na95Zea5eqnuQ',
161
- 'silas@t155.foobar.com' => 'qTaWjwsxrgCMA1DRaawEtL',
162
- 'simon@t156.foobar.com' => '4xbnT82V6YswZD8CADhToa',
163
- 'sophia@t157.foobar.com' => 'uSsimYXiJfpyVTEniSgdeB',
164
- 'stella@t158.foobar.com' => 'uhsAzfPV38gccUsiNNp1Ci',
165
- 'stellan@t159.foobar.com' => 'qwmeRueNtTA6BG87X5qfVi',
166
- 'stephen@t160.foobar.com' => 'p7LF1KEXBaqcEqqxxFdhLF',
167
- 'sullivan@t161.foobar.com' => 'sjbpK5vVjj9HEmFuimqw9S',
168
- 'susannah@t162.foobar.com' => 'wzzfj74UJdELhrLBC6qT32',
169
- 'talullah@t163.foobar.com' => '6Bv5sQYYGgEH8ocfpyVYEM',
170
- 'theo@t164.foobar.com' => 'btE6gi4ouzPVVB8vHuuYTz',
171
- 'theodore@t165.foobar.com' => 'inuCfNZXhBwqAd3eRdmucu',
172
- 'thomas@t166.foobar.com' => 'xo71nBSArfgxTzjbiu2no1',
173
- 'timothy@t167.foobar.com' => 'mCpPnySkinUWyL42qxedyd',
174
- 'victor@t168.foobar.com' => 'ktKMp7zpvznh9eJe5wpGDP',
175
- 'victoria@t169.foobar.com' => 'm2cfi3nqGKGsnaKKZi6Gng',
176
- 'vincent@t170.foobar.com' => '4zxVvtDST2izRT5agTNDSq',
177
- 'violet@t171.foobar.com' => 'mR6C6C3vTeQRW28PfarMW8',
178
- 'virginia@t172.foobar.com' => 'sgC4TvD2PvgogA9hg9SXwf',
179
- 'walter@t173.foobar.com' => 'tmSRjaqamj5apt2SZ6Q1f1',
180
- 'william@t174.foobar.com' => '3CxxK9U1RkWKczEon2nEWh',
181
- 'zachary@t175.foobar.com' => '6PWcERtfib8AGNLQk3SHVT'
182
- }
183
-
184
- def test_md5_base58
185
- MD5_EXAMPLES.each do |data, expected|
186
- assert_equal expected, Base58GMP.md5_base58(data)
187
- end
188
- end
189
-
190
- end