No description
Find a file
2025-08-27 03:48:12 +01:00
.github/workflows Fix workflow 2025-02-19 18:01:24 +00:00
src Use a define flag instead 2025-02-19 17:51:46 +00:00
tests Use a define flag instead 2025-02-19 17:51:46 +00:00
.gitignore Add support for 2023-10-31 10:02:44 +00:00
crockfordb32.nimble Add package.skull.toml 2025-08-27 03:48:12 +01:00
package.skull.toml Add package.skull.toml 2025-08-27 03:48:12 +01:00
README.md Use a define flag instead 2025-02-19 17:51:46 +00:00

Crockford Base32 (Nim)

This is an unfinished implementation of Crockford Base32 in Nim, it doesn't support checking, but PRs are welcome if someone wishes to implement that.

If you're using nint128 in your project, we support encoding or decoding of those types too, just define crockfordb32NintSupport!

stint support is unimplemented, but planned to be added in the future.

This project is also licensed under CC0, so it can be used in any way, shape or form! No credit needed (but still appreciated)!

Usage

import crockfordb32

let encoded = int.encode(2829)
echo encoded  # Output is `2RD`

let decoded = int.decode("2RD")
echo decoded  # Output is `2829`

The encode functions additionally have a length parameter allowing you to pad the generated string (for example, ULIDs must be 26 characters long).