Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
cashaddrjs
Advanced tools
Readme
JavaScript implementation for the new CashAddr address format for Bitcoin Cash.
Compliant with the original CashAddr specification which improves upon BIP 173.
Note: This is a JavaScript implementation of the CashAddr format specification. If you are looking for a general purpose Bitcoin Cash address translation library, check out the easy-to-use and well-tested BchAddr.js.
$ npm install --save cashaddrjs
$ bower install --save cashaddrjs
You may also download the distribution file manually and place it within your third-party scripts directory: dist/cashaddrjs-0.4.4.min.js.
const cashaddr = require('cashaddrjs');
const address = 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a';
const { prefix, type, hash } = cashaddr.decode(address);
console.log(prefix); // 'bitcoincash'
console.log(type); // 'P2PKH'
console.log(hash); // Uint8Array [ 118, 160, ..., 115 ]
console.log(cashaddr.encode(prefix, type, hash)); // 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a'
Note: This is a JavaScript implementation of the CashAddr format specification. If you are looking for an easy-to-use and well-tested library to translate between different formats, check out BchAddr.js.
You may include a script tag in your HTML and the cashaddr
module will be defined globally on subsequent scripts.
<html>
<head>
...
<script src="https://unpkg.com/cashaddrjs@0.4.4/dist/cashaddrjs-0.4.4.min.js"></script>
</head>
...
</html>
$ npm run docs
Browse automatically generated jsdocs online.
FAQs
Bitcoin Cash cashaddr address format support for Node.js and web browsers.
The npm package cashaddrjs receives a total of 35,014 weekly downloads. As such, cashaddrjs popularity was classified as popular.
We found that cashaddrjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.