Socket
Socket
Sign inDemoInstall

wif

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wif - npm Package Compare versions

Comparing version 3.0.1 to 4.0.0

8

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc