@abcnews/base-36-text
v1.0.1
Published
Tools for encoding / decoding text to / from base36 strings
Downloads
24
Keywords
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:
npx @abcnews/base-36-text encode 'example text'
> 31ltulurfcfzwo4gm7o
npx @abcnews/base-36-text decode 31ltulurfcfzwo4gm7o
> example text
As a library (node or browser)
npm i @abcnews/base-36-text
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:
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()
.