Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 2.04 KB

File metadata and controls

69 lines (45 loc) · 2.04 KB

@se-oss/base32

CI NPM Version MIT License Install Size

A simple base32 encoder and decoder supporting both RFC 4648 and Crockford variants.


📦 Installation

pnpm add @se-oss/base32

📖 Usage

RFC 4648

import { 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 world

Crockford

import { 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 world

📚 Documentation

For all configuration options, please see the API docs.

🚀 Future Enhancements

  • Implement Crockford's checksum feature.

🤝 Contributing

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! 🙏

License

MIT © Shahrad Elahi and contributors.