4.0.1 • Published 4 years ago

bs58 v4.0.1

Weekly downloads
273,391
License
MIT
Repository
github
Last release
4 years ago

bs58

build status

JavaScript component to compute base 58 encoding. This encoding is typically used for crypto currencies such as Bitcoin.

Note: If you're looking for base 58 check encoding, see: https://github.com/bitcoinjs/bs58check, which depends upon this library.

Install

npm i --save bs58

API

encode(input)

input must be a Buffer or an Array. It returns a string.

example:

const bs58 = require('bs58')

const bytes = Buffer.from('003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187', 'hex')
const address = bs58.encode(bytes)
console.log(address)
// => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS

decode(input)

input must be a base 58 encoded string. Returns a Buffer.

example:

const bs58 = require('bs58')

const address = '16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS'
const bytes = bs58.decode(address)
console.log(out.toString('hex'))
// => 003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187

Hack / Test

Uses JavaScript standard style. Read more:

js-standard-style

Credits

License

MIT

@whaleshares/cncjs@whaleshares/excjs@whaleshares/wlsjs@xazab/dpp@xazab/drive@xazab/xazabcore-lib@xazabevo/xazabcore-lib@xswap/v2-core@xstorage/xs-js-ipld-dag-cbor@xstorage/xs-js-ipld-dag-pb@xstorage/xs-js-libp2p-crypto@xstorage/xs-js-peer-book@zerowood/camn-core@zerowood/pkgtestaltcoin-explorersaltcore-libaltweb3altiuscore-libamalgam-jsaleph-jsaelf-sdkaelf-sdk-lys-testaelf-sdk-lys1988aegir-test-repocos-grpc-jsb2x-core-libconnext-nsawesome-tps-libconsus-coreband.jsbase58-nodesbase58checkbch-js-joeybch-js-regbeowulf-jsbeowulf-js-testnetcredits-lib-jsberycore-libcreacore-libcrypto-addr-codeccrypto-clientbcx-coresbcxjs-coresbcljs-corebcschainweb3bcscore-libbellcore-libbeyondcore-libbeyondauthbfvbedrock-data-hub-storagebedrock-edv-storagebedrock-keycrypto-io-walletconviction-slacontract-vmb2bnetbac-mnemonicbac-lib-testcsc-bitcorecsc-bitcore-libbitcoinlikejsbitcoinsourcebitcoinutilbitcoin3jsbitcoinaddrcheckbitcoincashflowbitcoincashjs-forkbitcoincashjs-yarnbitcore-audax-libbitcore-bip39bitcoin-sv-libbitcore-lib-macbitcore-lib-matrixbitbitcore-lib-matrixbitsbitcore-lib-monacocoinbitcore-lib-monacoinbitcore-lib-monoecibitcore-lib-mue2bitcore-lib-mxbitcore-lib-mxbitbitcore-lib-mycoinbitcore-lib-p256bitcore-lib-pacbitcore-lib-pcxbitcore-lib-pivxbitcore-lib-polisbitcore-lib-posqbitcore-lib-pushibitcore-lib-rapturebitcore-lib-react-nativebitcore-lib-resistancebitcore-lib-safebitcore-lib-sibbitcore-lib-sibcoinbitcore-lib-sumcoinbitcore-lib-svbitcore-lib-syscoinbitcore-lib-tcrbitcore-lib-tecra
4.0.1

4 years ago

4.0.0

4 years ago

3.1.0

4 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago