cashaddrjs
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"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( |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1088981
46