start to split into node commonjs style modules
- no longer is the global Bitcoin used for modules - cleaner and more maintainable code - add more tests
This commit is contained in:
parent
a6f05fb505
commit
0faac29134
35 changed files with 3401 additions and 3169 deletions
test
15
test/base58.js
Normal file
15
test/base58.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
var assert = require('assert');
|
||||
var base58 = require('../').base58;
|
||||
var conv = require('../').convert;
|
||||
|
||||
test('decode base58', function() {
|
||||
var enc = '5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ';
|
||||
var hex = '800c28fca386c7a227600b2fe50b7cae11ec86d3bf1fbe471be89827e19d72aa1d507a5b8d';
|
||||
assert.deepEqual(base58.decode(enc), conv.hexToBytes(hex));
|
||||
});
|
||||
|
||||
test('encode base58', function() {
|
||||
var enc = '5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ';
|
||||
var hex = '800c28fca386c7a227600b2fe50b7cae11ec86d3bf1fbe471be89827e19d72aa1d507a5b8d';
|
||||
assert.equal(base58.encode(conv.hexToBytes(hex)), enc);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue