Changes existing code to use new base58 API

This commit is contained in:
Daniel Cousens 2014-04-04 05:10:12 +11:00
parent f53b821cc9
commit 6fa0c07763
7 changed files with 83 additions and 52 deletions

View file

@ -8,6 +8,11 @@ function lpad(str, padString, length) {
}
function bytesToHex(bytes) {
// FIXME: transitionary fix
if (Buffer.isBuffer(bytes)) {
return bytes.toString('hex')
}
return bytes.map(function(x) {
return lpad(x.toString(16), '0', 2)
}).join('')