New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bitcoin-address-soft-regex-validation

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-soft-regex-validation

A single-function package to performa soft (no checksum) bitcoin address (Base58 and Bech32) validation

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
increased by171.43%
Maintainers
1
Weekly downloads
 
Created
Source

bitcoin-address-soft-regex-validation

Build Status Build Cron Coverage Status TypeScript

Performs a soft (syntactically-only) validation of Bitcoin address (both Base58 and Bech32, both Mainnet and Testnet). It takes for granted that you have a stronger (maybe server side) Checksum validation.

npm install --save bitcoin-address-soft-regex-validation
const {isValidBitcoinAddress} = require("bitcoin-address-soft-regex-validation");
// a mainnet address
isValidBitcoinAddress("1JDknRvZTi5XdhQB3cgvJ9R8aogUvfbYUB"); // "mainnet"
// a testnet address
isValidBitcoinAddress("tb1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"); // "testnet"
// an invalid address
isValidBitcoinAddress("fake-address"); // undefined

Remember that it's not so important if some false positives pass the validation (as said above, it takes for granted that a serious validation is made elsewhere), the only important thing is that no one valid address is blocked.

It's bases on some resources like this one, this one and mixed together on Regex101.

It has no dependencies and it's a single-function package, check the index.js file to copy the code and avoid adding one more dependency if you want.

Last but not least: it's written in TypeScript.

Contributors

Thanks goes to these wonderful people (emoji key):

Stefano Magni
Stefano Magni

💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

FAQs

Package last updated on 30 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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