Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coinstring

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coinstring - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

8

CHANGELOG.md

@@ -0,1 +1,9 @@

2.0.0 / 2014-06-25
------------------
* changed `encode(payload, version)` to `encode(payload, [version])`
* changed how `decode` works (**broke compatibility** hence major version bump)
old version returned `{payload: ..., version: ...}`, this version now returns
just `payload`, if `version` is passed into `decode`, it's trimmed off of `payload`
1.0.1 / 2014-06-06

@@ -2,0 +10,0 @@ ------------------

20

lib/coinstring.js

@@ -9,10 +9,13 @@ var crypto = require('crypto')

assert(version != null, 'must pass version')
var buf
if (version != null) {
if (typeof version == 'number')
version = new Buffer([version])
buf = Buffer.concat([version, payload])
} else {
buf = payload
}
if (typeof version == 'number')
version = new Buffer([version])
var buf = Buffer.concat([version, payload])
var checksum = sha256x2(buf).slice(0, 4)
var result = Buffer.concat([version, payload, checksum])
var result = Buffer.concat([buf, checksum])
return base58.encode(result)

@@ -26,3 +29,3 @@ }

if (version == null)
versionLength = 1
versionLength = 0
else {

@@ -46,3 +49,3 @@ if (typeof version == 'number')

return {version: bytes.slice(0, versionLength), payload: bytes.slice(versionLength)}
return bytes.slice(versionLength)
}

@@ -91,2 +94,1 @@

}
{
"name": "coinstring",
"version": "1.0.1",
"version": "2.0.0",
"description": "Create and parse crypto currency addresses and wallet import formats.",

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

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