🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

base58-js

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base58-js

A light weight universal JavaScript base58 encoder / decoder.

1.0.0
Source
npm
Version published
Weekly downloads
117K
3.48%
Maintainers
1
Weekly downloads
 
Created
Source

base58 logo

base58-js

A light weight (~560 byte) universal JavaScript base58 encoder / decoder.

Support

  • Node.js >= 8
  • Browser list defaults not IE 11.

Setup

$ npm i base58-js

API

Table of contents

namespace base58_chars

Base58 characters must only include numbers 123456789, uppercase ABCDEFGHJKLMNPQRSTUVWXYZ and lowercase abcdefghijkmnopqrstuvwxyz.

Type: string

function base58_to_binary

Converts a base58 string to its corresponding binary representation.

ParameterTypeDescription
base58Stringbase58_charsbase58 encoded string

Returns: Uint8Array — binary representation for the base58 string.

Examples

Ways to import.

import { base58_to_binary } from 'base58-js'

Ways to require.

const { base58_to_binary } = require('base58-js')

Usage.

const bin = base58_to_binary('6MRy')
console.log(bin)

Logged output will be Uint8Array(3) [15, 239, 64].

function binary_to_base58

Converts a Uint8Array into a base58 string.

ParameterTypeDescription
uint8arrayUint8Array | ArrayUnsigned integer.

Returns: base58_chars — The base58 string representation of the binary array.

Examples

Ways to require.

const { binary_to_base58 } = require('base58-js')

Ways to import.

import { binary_to_base58 } from 'base58-js'

Usage.

const str = binary_to_base58([15, 239, 64])
console.log(str)

Logged output will be 6MRy.

Keywords

base58

FAQs

Package last updated on 18 Jan 2021

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