Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Consider adding one or two extra characters to the encoding for a checksum #14

Open
loreto opened this issue Jun 30, 2023 · 1 comment

Comments

@loreto
Copy link
Contributor

loreto commented Jun 30, 2023

One the top comments in the HackerNews discussion was:

I've been doing this kind of thing for years with two notable differences:
...

I add two base-32 characters as a checksum (salted of course). This is prevents having to go look at the datastore when the
value is bogus either by accident or malice. I'm unsure why other implementations don't do this.

Should we do that as part of the official TypeID spec?

@conradludgate
Copy link
Contributor

checksum (salted of course)
value is bogus either by accident or malice

This is implying some cryptographic solution AFAIU (A CRC checksum won't protect from malice). I feel like a cryptographic addition to this specification would overcomplicate it considerably and add.

With adding 2 extra base32 characters, however, we have 12 bits to play with, so we can use a CRC-12 for the checksum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants