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

bitcoin-address

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin-address - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

LICENSE

6

base58.js

@@ -46,2 +46,8 @@

// strings starting with only ones need to be adjusted
// e.g. '1' should map to '00' and not '0000'
if (leading_zero && !seen_other) {
--leading_zero;
}
while (leading_zero-- > 0) {

@@ -48,0 +54,0 @@ hex = '00' + hex;

7

index.js

@@ -20,4 +20,5 @@

function get_address_type(address) {
var decoded_hex;
try {
var decoded_hex = base58.decode(address);
decoded_hex = base58.decode(address);
} catch (e) {

@@ -40,3 +41,3 @@ // if decoding fails, assume invalid address

var good_cksum = sha256_digest(sha256_digest(body)).substr(0,4);
var good_cksum = sha256_digest(sha256_digest(body)).toString('binary').substr(0,4);
return (cksum === good_cksum ? decoded_hex.slice(0, 2) : null);

@@ -74,3 +75,3 @@ }

function sha256_digest(payload) {
return crypto.createHash('sha256').update(payload).digest('binary');
return crypto.createHash('sha256').update(payload).digest();
}

@@ -5,3 +5,3 @@ {

"description": "bitcoin address verification and other related functions",
"version": "0.2.0",
"version": "0.3.0",
"homepage": "https://github.com/defunctzombie/bitcoin-address",

@@ -8,0 +8,0 @@ "repository": {

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