Nondeterministic Programming Methodology
Have ideas to improve npm?Join in the discussion! »

wif
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/wif package

2.0.6 • Public • Published

WIF

TRAVIS NPM

js-standard-style

Bitcoin Wallet Import Format encoding/decoding module.

Example

var wif = require('wif')
 
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.encode(obj)
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn

LICENSE MIT

Install

npm i wif

DownloadsWeekly Downloads

45,437

Version

2.0.6

License

MIT

Last publish

Collaborators

  • avatar
  • avatar
  • avatar