Comparing version 3.0.1 to 4.0.0
@@ -30,6 +30,8 @@ var bs58check = require('bs58check') | ||
function encodeRaw (version, privateKey, compressed) { | ||
var result = new Buffer(compressed ? 34 : 33) | ||
if (privateKey.length !== 32) throw new TypeError('Invalid privateKey length') | ||
result.writeUInt8(version, 0) | ||
privateKey.copy(result, 1) | ||
var result = new Uint8Array(compressed ? 34 : 33) | ||
var view = new DataView(result.buffer) | ||
view.setUint8(0, version) | ||
result.set(privateKey, 1) | ||
@@ -36,0 +38,0 @@ if (compressed) { |
{ | ||
"name": "wif", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"description": "Bitcoin Wallet Import Format (WIF) decoding/encoding module", | ||
@@ -28,2 +28,5 @@ "author": "Daniel Cousens", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
@@ -37,9 +40,10 @@ "coverage-report": "nyc report --reporter=lcov", | ||
"dependencies": { | ||
"bs58check": "^2.0.1" | ||
"bs58check": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"nyc": "^6.4.0", | ||
"standard": "*", | ||
"tape": "^4.6.2" | ||
"nyc": "^15.0.0", | ||
"standard": "^14.3.3", | ||
"tape": "^4.13.2", | ||
"uint8array-tools": "0.0.7" | ||
} | ||
} |
# WIF | ||
[![TRAVIS](https://secure.travis-ci.org/bitcoinjs/wif.png)](http://travis-ci.org/bitcoinjs/wif) | ||
@@ -15,6 +14,4 @@ [![NPM](http://img.shields.io/npm/v/wif.svg)](https://www.npmjs.org/package/wif) | ||
var wif = require('wif') | ||
var privateKey = new Buffer('0000000000000000000000000000000000000000000000000000000000000001', 'hex') | ||
var key = wif.encode(128, privateKey, true) | ||
var privateKey = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex') | ||
var key = wif.encode(128, privateKey, true) // for the testnet use: wif.encode(239, ... | ||
// => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn | ||
@@ -29,2 +26,6 @@ | ||
wif.decode(key, 0x09) | ||
// => Error: Invalid network version | ||
// alternative syntax | ||
wif.encode(obj) | ||
@@ -31,0 +32,0 @@ // => KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34
4674
4
4
52
1
+ Added@noble/hashes@1.5.0(transitive)
+ Addedbase-x@4.0.0(transitive)
+ Addedbs58@5.0.0(transitive)
+ Addedbs58check@3.0.1(transitive)
- Removedbase-x@3.0.10(transitive)
- Removedbs58@4.0.1(transitive)
- Removedbs58check@2.1.2(transitive)
- Removedcipher-base@1.0.4(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedhash-base@3.1.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedbs58check@^3.0.1