New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

coinkey

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coinkey - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

3.0.0 / 2018-06-05
------------------
- Drop support for Node versions less than v6
- Add support for ZCash and other coins with multibyte public versions
2.0.0 / 2016-04-27

@@ -2,0 +7,0 @@ ------------------

6

lib/coinkey.js

@@ -26,3 +26,4 @@ var assert = require('assert')

Object.defineProperty(CoinKey.prototype, 'versions', {
enumerable: true, configurable: true,
enumerable: true,
configurable: true,
get: function () {

@@ -44,3 +45,4 @@ return this._versions

get: function () {
return cs.encode(this.pubKeyHash, this.versions.public)
var bufVersion = util.bufferizeVersion(this.versions.public)
return cs.encode(this.pubKeyHash, bufVersion)
}

@@ -47,0 +49,0 @@ })

@@ -7,5 +7,5 @@ // poor man's clone

function isArrayish (maybeArray) {
return Array.isArray(maybeArray)
|| (maybeArray instanceof Uint8Array)
|| Buffer.isBuffer(maybeArray)
return Array.isArray(maybeArray) ||
(maybeArray instanceof Uint8Array) ||
Buffer.isBuffer(maybeArray)
}

@@ -27,6 +27,30 @@

function bufferizeVersion (version) {
if (typeof version === 'string') return hexStringToBuffer(version)
if (typeof version === 'number') return beUIntToBuffer(version)
throw new Error('invalid version type.')
}
// accepts hex string sequence with or without 0x prefix
function hexStringToBuffer (input) {
var isValidRE = /^(0x)?([\dA-Fa-f]{2})+$/g
if (!isValidRE.test(input)) throw new Error('invalid hex string.')
return Buffer.from(input.slice(input.slice(0, 2) === '0x' ? 2 : 0), 'hex')
}
function beUIntToBuffer (num) {
var length
if (num === 0) length = 1
else if (num > 0) length = Math.ceil((Math.log(num + 1) / Math.log(2)) / 8)
var buf = Buffer.alloc(length)
buf.writeUIntBE(num, 0, length)
return buf
}
module.exports = {
clone: clone,
isArrayish: isArrayish,
normalizeVersions: normalizeVersions
normalizeVersions: normalizeVersions,
bufferizeVersion: bufferizeVersion
}
{
"name": "coinkey",
"version": "2.0.0",
"version": "3.0.0",
"description": "JavaScript component for private keys, public keys, and addresess for crypto currencies such as Bitcoin, Litecoin, and Dogecoin",

@@ -5,0 +5,0 @@ "keywords": [

@@ -19,3 +19,3 @@ coinkey

- license: **MIT**
- versioning: [http://semver-ftw.org](http://semver-ftw.org)
- versioning: **SemVer**

@@ -22,0 +22,0 @@

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