x-base-32
base32 encoding and decoding that optimizes byte size based on input characters and supports unicode.
Installation
$ npm install --save x-base-32
Usage
const xBase32 = ; xBase32;// => 🦁🐯🐻 xBase32;// => 89hmpyvkk41gpws10ehmpesbjecg62vk441h6arbjecgg7xBase32;// => bq8bt5v6xbfa0gbndw2xxf8qcvq842xbekqavmdv6xt116xBase32;// => brkwh64f37j8rqg86932fj4s3che933210s4c9y8k2zh8rmca844bxBase32;// => ged2npm7z1j0031jeaj6732qz047xBase32;// => bgdrk46a4p10gw0848a3h1kh08jr423g10gy8dc6j351ngt8e0445xBase32;// => g63mk191gn8rf6c3863431t9gd0rayc6yzw0gsxBase32;// => gv0zdv0er7qe2zp1xvgxg3 // Ignores invalid symbols during decodingxBase32;// => 🦁🐯🐻
Scheme Requirements
- Humans can accurately transmit the symbols to other humans using a telephone.
- Only use numeric and lowercase alpha characters:
[0-9]
,[a-h]
,j
,k
,m
,n
,[p-t]
,[v-z]
- Re-map certain error-prone characters when they are provided for decoding:
i -> 1 I -> 1 l -> 1 L -> 1 o -> 0 O -> 0
- Ignore all other characters providing during decoding
- Only use numeric and lowercase alpha characters:
- URI :: Path safe
- Case Insensitive File System safe
- Support the full 21-bit Unicode character set
- Append a check digit for validating data integrity
TODO
- [] Accept a
Buffer
- Provide a demo page
License
ISC © Buster Collings