dylanhart / ulid-rs

This is a Rust implementation of the ulid project

Home Page:https://crates.io/crates/ulid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose base32 implementation?

beanow-at-crabnebula opened this issue · comments

I had a look at #34 and ran into kind of the opposite situation.

Thanks for this crate :] currently using it for a number of ID fields.
However I ran into a case where I wanted to use the underlying base32 directly: JTIs.

When we're talking about a JWT we already have access to a timestamp (iat).
And so using ULIDs would make the timestamp data redundant.

Base32 encoding for 128 bits of data however is plenty sound!
So I thought about using the underlying base32 implementation and here we are.

Note: keep it as a low priority suggestion :]
I came up with an alternative format already being used as a dependency: base64url.
They're JWTs after all 😂

Copy-paste it if you want; it's licensed under MIT. I'm not personally interested in packaging it independently. Do be warned that the base32 representation is technically 130 bits that then get truncated into a u128.