package: use bs58check

This commit is contained in:
Daniel Cousens 2014-07-02 14:37:32 +10:00
parent ab20febbdc
commit 13c2d377e7
9 changed files with 5 additions and 280 deletions

View file

@ -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)
})
})
})
})