https://github.com/abcnews/base-36-text
Tools for encoding / decoding text to / from base36 strings
https://github.com/abcnews/base-36-text
tool
Last synced: 5 months ago
JSON representation
Tools for encoding / decoding text to / from base36 strings
- Host: GitHub
- URL: https://github.com/abcnews/base-36-text
- Owner: abcnews
- License: mit
- Created: 2022-03-03T00:37:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-09T05:21:07.000Z (over 3 years ago)
- Last Synced: 2025-11-22T22:03:52.653Z (7 months ago)
- Topics: tool
- Language: JavaScript
- Homepage: https://www.abc.net.au/res/sites/news-projects/base-36-text-converter/1.0.0/
- Size: 763 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base-36-text
Tools for encoding / decoding text to / from base36 strings.
## Usage
### As a CLI
Install globally with `npm i -g @abcnews/base-36-text` to use the `b36t` executable, or use npx:
```sh
npx @abcnews/base-36-text encode 'example text'
> 31ltulurfcfzwo4gm7o
npx @abcnews/base-36-text decode 31ltulurfcfzwo4gm7o
> example text
```
### As a library (node or browser)
```sh
npm i @abcnews/base-36-text
```
```js
import { encode, decode } from '@abcnews/base-36-text';
encode('example text');
// > 31ltulurfcfzwo4gm7o
decode('31ltulurfcfzwo4gm7o');
// > 'example text'
```
A browser usage example is included with this project. To try it:
```sh
git clone https://github.com/abcnews/base-36-text
cd base-36-text
npm run example
```
...then open the console in the browser window that opens, and try out `b36t.encode()` and `b36t.decode()`.