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

cashaddrjs

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cashaddrjs - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

dist/cashaddrjs-0.1.4.min.js

2

package.json
{
"name": "cashaddrjs",
"version": "0.1.3",
"version": "0.1.4",
"description": "Bitcoin Cash cashaddr address format support for Node.js and web browsers.",

@@ -5,0 +5,0 @@ "main": "src/cashaddr.js",

@@ -27,3 +27,3 @@ # CashAddr.js: The new Bitcoin Cash address format for Node.js and web browsers.

You may also download the distribution file manually and place it within your third-party scripts directory: [dist/cashaddrjs-0.1.3.min.js](https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/f700942f/dist/cashaddrjs-0.1.3.min.js).
You may also download the distribution file manually and place it within your third-party scripts directory: [dist/cashaddrjs-0.1.4.min.js](https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/f700942f/dist/cashaddrjs-0.1.4.min.js).

@@ -63,3 +63,3 @@ ## Usage

...
<script src="https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/master/dist/cashaddrjs-0.1.3.min.js"></script>
<script src="https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/master/dist/cashaddrjs-0.1.4.min.js"></script>
</head>

@@ -66,0 +66,0 @@ ...

@@ -18,3 +18,3 @@ /***

* @param {string} prefix Network prefix. E.g.: 'bitcoincash'.
* @param {string} type Type of address to generate. Either 'P2KH' or 'P2SH'.
* @param {string} type Type of address to generate. Either 'P2PKH' or 'P2SH'.
* @param {Array} hash Hash to encode represented as an array of 8-bit integers.

@@ -77,7 +77,7 @@ */

*
* @param {string} type Address type. Either 'P2KH' or 'P2SH'.
* @param {string} type Address type. Either 'P2PKH' or 'P2SH'.
*/
function getTypeBits(type) {
switch (type) {
case 'P2KH':
case 'P2PKH':
return 0;

@@ -100,3 +100,3 @@ case 'P2SH':

case 0:
return 'P2KH';
return 'P2PKH';
case 8:

@@ -103,0 +103,0 @@ return 'P2SH';

@@ -18,3 +18,3 @@ /***

const ADDRESS_TYPES = ['P2KH', 'P2SH'];
const ADDRESS_TYPES = ['P2PKH', 'P2SH'];

@@ -29,3 +29,3 @@ const VALID_SIZES = [20, 24, 28, 32, 40, 48, 56, 64];

const EXPECTED_P2KH_OUTPUTS = [
const EXPECTED_P2PKH_OUTPUTS = [
'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a',

@@ -71,4 +71,4 @@ 'bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy',

assert.equal(
cashaddr.encode('bitcoincash', 'P2KH', TEST_HASHES[index]),
EXPECTED_P2KH_OUTPUTS[index]
cashaddr.encode('bitcoincash', 'P2PKH', TEST_HASHES[index]),
EXPECTED_P2PKH_OUTPUTS[index]
);

@@ -75,0 +75,0 @@ assert.equal(

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