5.0.0 • Published 2 years ago
wif v5.0.0
WIF
Bitcoin Wallet Import Format encoding/decoding module.
Example
import * as wif from "wif"
var privateKey = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
var key = wif.encode({version: 128, privateKey, compressed: true}) // for the testnet use: wif.encode(239, ...
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn
var obj = wif.decode(key)
// => {
// version: 128,
// privateKey: Uint8Array(32) [
// 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0, 0, 0, 0, 1
// ],
// compressed: true
//}
wif.decode(key, 0x09)
// => Error: Invalid network version
// alternative syntax
wif.encode(obj)
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWnLICENSE MIT
5.0.0
2 years ago
4.0.0
3 years ago
2.0.6
9 years ago
3.0.1
9 years ago
3.0.0
9 years ago
2.0.5
9 years ago
2.0.4
10 years ago
2.0.3
10 years ago
2.0.2
10 years ago
2.0.1
10 years ago
2.0.0
10 years ago
1.2.1
11 years ago
1.2.0
11 years ago
1.1.2
11 years ago
1.1.1
11 years ago
1.1.0
11 years ago
1.0.0
11 years ago
0.0.1
11 years ago
