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.0.1 to 0.0.2

18

index.js

@@ -13,2 +13,7 @@

var p2sh_types = {
prod: '05',
testnet: 'c4'
};
/// check if a wallet address is valid

@@ -20,6 +25,2 @@ /// if address_type is supplied

if (address.length !== 34 && address.length !== 33) {
return false;
}
var decoded_hex = base58.decode(address);

@@ -46,5 +47,8 @@

// check that the address type is correct if requested
if(address_type &&
decoded_hex.slice(0, 2) !== address_types[address_type]) {
return false;
if (address_type) {
var type = decoded_hex.slice(0, 2);
if (type !== address_types[address_type] &&
type !== p2sh_types[address_type]) {
return false;
}
}

@@ -51,0 +55,0 @@

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

"description": "bitcoin address verification and other related functions",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com/shtylman/bitcoin-address",

@@ -19,3 +19,3 @@ "repository": {

"devDependencies": {
"mocha": "1.1.x"
"mocha": "1.2.x"
},

@@ -22,0 +22,0 @@ "main": "index",

@@ -1,4 +0,4 @@

# address [![Build Status](https://secure.travis-ci.org/shtylman/bitcoin-address.png)](http://travis-ci.org/shtylman/bitcoin-address) #
# bitcoin-address [![Build Status](https://secure.travis-ci.org/shtylman/bitcoin-address.png)](http://travis-ci.org/shtylman/bitcoin-address) #
Provides utility functions for working with bitcoin addresses
Functions for working with bitcoin addresses

@@ -5,0 +5,0 @@ ## install ##

@@ -19,3 +19,9 @@ var address = require('..');

validate('116CGDLddrZhMrTwhCVJXtXQpxygTT1kHd');
// p2sh addresses
validate('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt');
validate('3NJZLcZEEYBpxYEUGewU4knsQRn1WM5Fkt', 'prod');
validate('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7');
validate('2MxKEf2su6FGAUfCEAHreGFQvEYrfYNHvL7', 'testnet');
});

Sorry, the diff of this file is not supported yet

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