https://github.com/pur3miish/base58-js
A light weight (~560 byte) universal JavaScript base58 encoder / decoder.
https://github.com/pur3miish/base58-js
Last synced: 3 months ago
JSON representation
A light weight (~560 byte) universal JavaScript base58 encoder / decoder.
- Host: GitHub
- URL: https://github.com/pur3miish/base58-js
- Owner: pur3miish
- License: mit
- Created: 2021-01-14T10:19:08.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T09:03:25.000Z (6 months ago)
- Last Synced: 2025-03-17T01:51:20.471Z (4 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/base58-js
- Size: 64.5 KB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README

# base58-js
[](https://www.npmjs.org/package/base58-js) [](https://github.com/pur3miish/base58-js/actions) [](https://github.com/pur3miish/base58-js/blob/main/LICENSE)
A light weight (\~560 byte) [universal JavaScript](https://en.wikipedia.org/wiki/Isomorphic_JavaScript) base58 encoder and decoder.
## Installation
For [Node.js](https://nodejs.org), to install [`base58-js`](https://npm.im/base58-js) run:
```sh
npm install base58-js
```## Requirements
Supported runtime environments:
- [Node.js](https://nodejs.org) versions `^16` || `>=17.0.0` .
- Browsers matching the [Browserslist](https://browsersl.ist) query [`> 0.5%, not OperaMini all, not dead`](https://browsersl.ist/?q=%3E+0.5%25%2C+not+OperaMini+all%2C+not+dead).## Examples
**Convert base58 to binary**
```js
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**
```js
import { binary_to_base58 } from "base58-js";const str = binary_to_base58([15, 239, 64]);
console.log(str);
```> The logged output was Thequickbrownfoxjumpedoverthea1zydog.
## Exports
Deep imports from the ECMAScript modules are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):
- [`index.js`](./index.js)
- [`create_base58_map.js`](./create_base58_map.js)
- [`binary_to_base58.js`](./binary_to_base58.js)
- [`base58_to_binary.js`](./base58_to_binary.js)
- [`base58_chars.js`](./base58_chars.js)IntelliSense via [TypeScript JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html).