A simple base32 encoder and decoder supporting both RFC 4648 and Crockford variants.
pnpm add @se-oss/base32import { decode, encode } from '@se-oss/base32';
const encoded = encode('hello world');
console.log(encoded); // NBSWY3DPEB3W64TMMQ======
const decoded = decode(encoded);
console.log(new TextDecoder().decode(decoded)); // hello worldimport { crockfordDecode, crockfordEncode } from '@se-oss/base32';
const encoded = crockfordEncode('hello world');
console.log(encoded); // D1JPRV3F41VPYWKCCG======
const decoded = crockfordDecode(encoded);
console.log(new TextDecoder().decode(decoded)); // hello worldFor all configuration options, please see the API docs.
- Implement Crockford's checksum feature.
Want to contribute? Awesome! To show your support is to star the project, or to raise issues on GitHub
Thanks again for your support, it is much appreciated! π
MIT Β© Shahrad Elahi and contributors.