Closed sonicdoe closed 7 years ago
nice, I wanted do this, but you first :)
please add output for out
<Buffer 00 3c 17 6e 65 9b ea 0f 29 a3 e9 bf 78 80 c1 12 b1 b3 1b 4d c8 26 26 81 87>
var bs58 = require('bs58')
var address = "16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS"
var out = bs58.decode(address)
console.log(out)
// => <Buffer 00 3c 17 6e 65 9b ea 0f 29 a3 e9 bf 78 80 c1 12 b1 b3 1b 4d c8 26 26 81 87>
Like this? Or would you like to have console.log(out)
in addition to console.log(out.toString('hex'))
?
ah, sorry.. lets stay with
var bs58 = require('bs58')
var address = "16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS"
var out = bs58.decode(address)
console.log(out.toString('hex'))
// => 003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187
Okay, updated.
Thank you!
Since v4.0.0,
decode
returns aBuffer
.