2.0.0 • Published 8 years ago

base58check v2.0.0

Weekly downloads
1,369
License
MIT
Repository
github
Last release
8 years ago

base58check

build status

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

Install

npm i --save base58check

API

string encode(data, prefix = '00', encoding = 'hex')

data must be a Buffer or a string. It returns a string.

example:

const base58check = require('base58check')

const data = '086eaa677895f92d4a6c5ef740c168932b5e3f44'
console.log(base58check.encode(data)) // => 1mayif3H2JDC62S4N3rLNtBNRAiUUP99k

{ prefix, data } decode(string, encoding)

string must be a base 58 check encoded string. Returns a Object for prefix & data.

example:

const base58check = require('base58check')

const address = '1mayif3H2JDC62S4N3rLNtBNRAiUUP99k'
console.log(base58check.decode(address))
// => { prefix: <Buffer 00>, data: <Buffer 08 6e aa 67 78 95 f9 2d 4a 6c 5e f7 40 c1 68 93 2b 5e 3f 44> }

// if using encoding
console.log(base58check.decode(address, 'hex'))
// => { prefix: '00', data: '086eaa677895f92d4a6c5ef740c168932b5e3f44' }

Hack / Test

Uses JavaScript standard style. Read more:

js-standard-style

Credits

  • unrealce for original JavaScript implementation

Related

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

License

The MIT License (MIT)

Copyright (c) 2016

@piriblockchain/coreboansdomains-uieladomain-ui@radar/redshift-api-client@radar/redshift-utils@anstest/ui@pnsdomains/ui@devdomains/ui@everything-registry/sub-chunk-1216myathhhh2023mintsbtc-bridge-libutremrealms-jsatomicals-jsmichelson-interpretermetaverse-tsmetaversejsgix-gix-polar-sharedgix-polar-sharedhbhbhbtesthayekensuihayeknsdomainsuimyathhhhmyathhhhppymakoto-ensdomains-uimakoto-uimanyfacedcoinmassa-web3polar-sharedprivatestorageprivatestorage-nodepnsdomains-ui-fixedmypowuisns-app-contract-apisns-uiuhrp-urlui-v10ui-ethers5023tradehub-api-js@ansdomain/ui@ansdomains/ui@bchdomains/ui@ace_domains/ui@dcnsdomains/ui@daodomains/ui@fnsdomains/ui@hidomains/ui@geens_npo/defined-id@nexis-network/domains-ui@ensdomains/ui@evmosdomains/ui@fantom_domains/ui@iotadomains/ui@jazdid/contract-ui@khelaia/hns-ui@khelaia/ui@cndllabs/ui@cubenameservice/ui@defichaindomains/uicron-wallet-alphacrypto-address-decodercrypto-address-encodereladomains-uieladomains-ui-mainnetecns-uielliptic-curve-signature-algoensdomainsuicid-app-sdkcid-app-sdk-testburn-addressdigiasset-decoderdigiasset-encodercashaccountscarbon-js-sdk@ringsnetwork/bns-util@testcnsdomains/ui@todd-test/ui@tomochain-name-service/ui@onusdomain/ui@onsdomains/ui@polkajs/elliptic-curve-signature-algo@pirichain/core@zalastax/nolb-base5@velnsdomains/ui@web03/ens-ui@vnsdomains/ui@spheron/ens-ui@soul-ensdomains/ui@sonalidomain/ui@sonalidomain/fns-uibit-iobitverse-atomicals-jsbitcoingoldjs-libbentong-multi-walletaddress-decoderatomicals-js-master@sepezho/massa-web3@siddomains/uiexpo-c32checkfns-ui
2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago