Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/the-ticking-clockwork/crockford-base32-nim
A simple implementation of Crockford Base32! Supports nint128, doesn't support check symbols.
https://github.com/the-ticking-clockwork/crockford-base32-nim
base32 crockford-base32 nim
Last synced: about 1 month ago
JSON representation
A simple implementation of Crockford Base32! Supports nint128, doesn't support check symbols.
- Host: GitHub
- URL: https://github.com/the-ticking-clockwork/crockford-base32-nim
- Owner: The-Ticking-Clockwork
- Created: 2023-09-01T01:38:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-31T10:10:12.000Z (over 1 year ago)
- Last Synced: 2024-11-08T17:56:56.630Z (3 months ago)
- Topics: base32, crockford-base32, nim
- Language: Nim
- Homepage: https://the-ticking-clockwork.github.io/Crockford-Base32-Nim/
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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`](https://github.com/rockcavera/nim-nint128)
in your project, we support encoding or decoding of those types too![`stint`](https://github.com/status-im/nim-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
```nim
import crockfordb32let 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).