Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

base58check

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base58check

Base58Check encoding

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
decreased by-17.7%
Maintainers
1
Weekly downloads
 
Created
Source

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
  • 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

Keywords

FAQs

Package last updated on 12 Sep 2016

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