1.0.0 • Published 5 years ago

wif-b4bcoin v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

WIF-B4Bcoin

NPM

js-standard-style

B4Bcoin Wallet Import Format encoding/decoding module.

Example

var wif = require('wif-b4bcoin')
var privateKey = new Buffer('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
var key = wif.encode(128, privateKey, true)
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

var obj = wif.decode(key)
// => {
//	version: 128,
//	privateKey: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01>,
//	compressed: true
//}

wif.decode(key, 0x09)
// => Error: Invalid network version

// alternative syntax
wif.encode(obj)
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

LICENSE MIT