Comparing version 2.0.0 to 2.0.1
22
index.js
@@ -29,6 +29,2 @@ var bs58check = require('bs58check') | ||
function decode (string, version) { | ||
return decodeRaw(bs58check.decode(string), version) | ||
} | ||
function encodeRaw (version, privateKey, compressed) { | ||
@@ -47,10 +43,16 @@ var result = new Buffer(compressed ? 34 : 33) | ||
function decode (string, version) { | ||
return decodeRaw(bs58check.decode(string), version) | ||
} | ||
function encode (version, privateKey, compressed) { | ||
if (typeof version !== 'number') { | ||
compressed = version.compressed | ||
privateKey = version.privateKey | ||
version = version.version | ||
} | ||
if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed)) | ||
return bs58check.encode(encodeRaw(version, privateKey, compressed)) | ||
return bs58check.encode( | ||
encodeRaw( | ||
version.version, | ||
version.privateKey, | ||
version.compressed | ||
) | ||
) | ||
} | ||
@@ -57,0 +59,0 @@ |
{ | ||
"name": "wif", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Bitcoin Wallet Import Format (WIF) encoding module", | ||
@@ -5,0 +5,0 @@ "author": "Daniel Cousens", |
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
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
8739
166