# micro-base58

> Fast and beautiful base58 encoder without dependencies.

Latest version **0.5.1** (published 2021-10-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install micro-base58
pnpm add micro-base58
yarn add micro-base58
bun add micro-base58
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2021-10-15 |
| First published | 2020-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Paul Miller |
| Maintainers | paulmillr |
| Keywords | base58, encode, encoder, base-x, base, base64 |

## Links

- npm: https://www.npmjs.com/package/micro-base58
- Repository: https://github.com/paulmillr/micro-base58
- Issues: https://github.com/paulmillr/micro-base58/issues
- npm.io page: https://npm.io/package/micro-base58

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.5.1 (latest) — 2021-10-15
- 0.5.0 — 2021-03-14
- 0.4.3 — 2020-06-17
- 0.4.2 — 2020-06-17
- 0.4.0 — 2020-06-17
- 0.3.2 — 2020-04-27
- 0.3.1 — 2020-04-27
- 0.3.0 — 2020-04-27

## README

# micro-base58

Fast and beautiful base58 encoder without dependencies.

**Deprecated. Switch to [micro-base](https://github.com/paulmillr/micro-base) for audited version of base58 and others.**

--------

> `npm install micro-base58`

Usage: `base58(text[, alphabet])`.

Included alphabets: `ipfs`/`btc` (default), `xrp`, `xmr`, `flickr`

First argument could be `string`, `Buffer` or `UInt8Array`.

```js
const base58 = require('micro-base58');

base58('hello world'); // => 'StV1DL6CwTryKyV'
new Uint8Array(Array.from('hello world').map(c => c.charCodeAt(0))) // Browser
// => 'StV1DL6CwTryKyV'
base58('hello world', 'xrp'); // => 'StVrDLaUATiyKyV'
```

We don't include base58check because it requires sha256. You can implement it like this:

```js
function base58check(array) {
  const checksum = sha256(sha256(array)).slice(0, 4);
  const data = new Uint8Array(array.length + 4);
  data.set(array);
  data.set(checksum, array.length)
  return base58(data);
}
```

## License

MIT License (c) 2020, Paul Miller (https://paulmillr.com).

See LICENSE file.

---
_Source: https://npm.io/package/micro-base58 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
