Name: wif
Owner: BitcoinJS
Description: Bitcoin Wallet Import Format JS encoding/decoding module
Created: 2015-08-20 09:56:08.0
Updated: 2018-05-11 22:20:14.0
Pushed: 2017-12-04 05:50:58.0
Size: 27
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Bitcoin Wallet Import Format encoding/decoding module.
wif = require('wif')
privateKey = new Buffer('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
key = wif.encode(128, privateKey, true)
> KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn
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
decode(key, 0x09)
> Error: Invalid network version
lternative syntax
encode(obj)
> KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn