Socket
Socket
Sign inDemoInstall

base58-js

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    base58-js

A light weight universal JavaScript base58 encoder / decoder.


Version published
Weekly downloads
27K
increased by3.72%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

2.0.0

Major

  • Upgraded to ESM as CJS is superseded.

Minor

Readme

Source

base58 logo

base58-js

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

Installation

For Node.js, to install base58-js run:

npm install base58-js

Requirements

Supported runtime environments:

Examples

Convert base58 to binary

import { base58_to_binary } from "base58-js";

const bin = base58_to_binary("6MRy");
console.log(bin);

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

Convert binary to base58

import { binary_to_base58 } from "base58-js";

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

Logged output will be 6MRy.

Ways to require in Common JS

Note

As base58 v2.0.0 is an ESM module if you need to require it in a Common JS package, then you can require like this:

(async function () {
  const { base58_to_binary, binary_to_base58 } = await import("base58-js");
  console.log(
    binary_to_base58(base58_to_binary("Thequickbrownfoxjumpedoverthea1zydog"))
  );
})();

The logged output was Thequickbrownfoxjumpedoverthea1zydog.

Exports

Deep imports from the ECMAScript modules are exported via the package.json field exports:

IntelliSense via TypeScript JSDoc.

Keywords

FAQs

Last updated on 21 Feb 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc