All Projects → sasaplus1 → base62.js

sasaplus1 / base62.js

Licence: MIT License
base62 encode/decode library

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to base62.js

Base62
PHP Base62 encoder and decoder for integers and big integers with Laravel 5 support.
Stars: ✭ 16 (-11.11%)
Mutual labels:  base62
Base62x
Base62x is an alternative approach to Base 64 without symbols in output.
Stars: ✭ 38 (+111.11%)
Mutual labels:  base62
token
A simple base62 encoded token library for go, ideal for short url services.
Stars: ✭ 68 (+277.78%)
Mutual labels:  base62
urlpack
Pure JavaScript toolkit for data URLs (MessagePack, Base58 and Base62)
Stars: ✭ 51 (+183.33%)
Mutual labels:  base62
friendly-id
Java Friendly Id for UUID
Stars: ✭ 173 (+861.11%)
Mutual labels:  base62
basex
Arbitrary base encoding in GO
Stars: ✭ 39 (+116.67%)
Mutual labels:  base62
lzbase62
LZ77(LZSS) based compression algorithm in base62 for JavaScript.
Stars: ✭ 38 (+111.11%)
Mutual labels:  base62
base62
Compact and high performace implementation of base62 algorithm for Golang.
Stars: ✭ 28 (+55.56%)
Mutual labels:  base62

base62.js

test npm version Try base62.js on RunKit renovate

base62 encode/decode library

Installation

npm

$ npm install base62.js

yarn

$ yarn add base62.js

Usage

node.js

const base62 = require('base62.js');

browser

<script src="base62.min.js"></script>

if use in Internet Explorer, base62.js needs Number.isSafeInteger polyfill:

<script src="https://polyfill.io/v3/polyfill.min.js?features=Number.isSafeInteger"></script>
<script src="base62.min.js"></script>

Example

base62.encode(39134); // "abc"
base62.decode('abc'); // 39134

const originalTable = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

base62.encode(39134, originalTable); // "ABC"
base62.decode('ABC', originalTable); // 39134

Functions

see documents

License

The MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].