# base70

> Converts dec number to base 70 and back

Latest version **1.0.2** (published 2018-03-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install base70
pnpm add base70
yarn add base70
bun add base70
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-03-17 |
| First published | 2018-03-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maksims Strasinskis |
| Maintainers | m16s |
| Keywords | base, 70, radix |

## Links

- npm: https://www.npmjs.com/package/base70
- Repository: https://github.com/m16s/base70
- Homepage: https://github.com/m16s/base70#readme
- Issues: https://github.com/m16s/base70/issues
- npm.io page: https://npm.io/package/base70

## Dependencies (2)

- [npm](https://npm.io/package/npm.md) ^5.7.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.5

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

- 1.0.2 (latest) — 2018-03-17
- 1.0.1 — 2018-03-17

## README

# Description

Small functions to convert numbers to base 70 string (e.g. 1520893643779 = "6vv6Bu~") and back.
Provides more efficient way to store big numbers (e.g. for IDs or to reduce JSON size):

| bytes | max value | string representation |
| ----- |:---------:| ---------:|
| 1 | 69 | "~"
| 2 | 4899 | "~~"
| 3 | 342999 | "~~~"
| 4 | 24009999 | "~~~~"
| 5 | 1680699999 | "~~~~~"
| 6 | 117648999999 | "~~~~~~"
| 7 | 8235429999999 | "~~~~~~~"
| 8 | 576480099999999 | "~~~~~~~~"

- `toBase70(number)` - converts a number (int) to a string (radix = 70)
- `fromBase70(string)` - parses a string (result of toBase70 function) and returns an number (int).

*currently works only with unsigned integers

# Encoding

`toBase70()` produces only URL friendly characters. Actually all of them except `-` (which can be used as separator between encoded values)

| Symbol | Value 
| ------ | ----:
| ! | 0
| ' | 1
| ( | 2
| ) | 3
| * | 4
| . | 5
| 0 | 6
| 1 | 7
| 2 | 8
| 3 | 9
| 4 | 10
| 5 | 11
| 6 | 12
| 7 | 13
| 8 | 14
| 9 | 15
| A | 16
| B | 17
| C | 18
| D | 19
| E | 20
| F | 21
| G | 22
| H | 23
| I | 24
| J | 25
| K | 26
| L | 27
| M | 28
| N | 29
| O | 30
| P | 31
| Q | 32
| R | 33
| S | 34
| T | 35
| U | 36
| V | 37
| W | 38
| X | 39
| Y | 40
| Z | 41
| _ | 42
| a | 43
| b | 44
| c | 45
| d | 46
| e | 47
| f | 48
| g | 49
| h | 50
| i | 51
| j | 52
| k | 53
| l | 54
| m | 55
| n | 56
| o | 57
| p | 58
| q | 59
| r | 60
| s | 61
| t | 62
| u | 63
| v | 64
| w | 65
| x | 66
| y | 67
| z | 68
| ~ | 69

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