package: use bs58check
This commit is contained in:
parent
ab20febbdc
commit
13c2d377e7
9 changed files with 5 additions and 280 deletions
test
|
@ -1,34 +0,0 @@
|
|||
var assert = require('assert')
|
||||
var base58check = require('../src/base58check')
|
||||
|
||||
var fixtures = require('./fixtures/base58check.json')
|
||||
|
||||
describe('base58check', function() {
|
||||
describe('decode', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('can decode ' + f.string, function() {
|
||||
var actual = base58check.decode(f.string).toString('hex')
|
||||
|
||||
assert.equal(actual, f.payload)
|
||||
})
|
||||
})
|
||||
|
||||
fixtures.invalid.forEach(function(f) {
|
||||
it('throws on ' + f, function() {
|
||||
assert.throws(function() {
|
||||
base58check.decode(f)
|
||||
}, /Invalid checksum/)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('encode', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
it('can encode ' + f.string, function() {
|
||||
var actual = base58check.encode(new Buffer(f.payload, 'hex'))
|
||||
|
||||
assert.strictEqual(actual, f.string)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue