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

Add function to convert a Dato ID (Base64-encoded, URL-safe) back to a regular v4 UUID hex string #20

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

arcataroger
Copy link
Member

Simple function that reverses our special encoding. Given an generated ID like WTyssHtyTzu9_EbszSVhPw, it will return 593cacb0-7b72-4f3b-bdfc-46eccd25613f.

@arcataroger arcataroger self-assigned this Mar 22, 2024
@arcataroger arcataroger marked this pull request as ready for review March 22, 2024 17:37
@arcataroger arcataroger added the enhancement New feature or request label Mar 22, 2024
@stefanoverna stefanoverna force-pushed the datoid-to-uuid branch 4 times, most recently from 36f84de to 6c4caea Compare March 26, 2024 10:06
@stefanoverna
Copy link
Member

As I was saying, I don't think we need to expose a function that converts to a classic UUID format. We don't use such format at all. It seems more useful to me to offer a validateId() function instead, which documents what we consider a valid ID, so that if someone wants to generate IDs manually, they can verify that they are correctly formatted.

@stefanoverna stefanoverna force-pushed the datoid-to-uuid branch 3 times, most recently from 9a5bd21 to 51d39b1 Compare March 26, 2024 10:15
@stefanoverna stefanoverna merged commit a762221 into main Mar 26, 2024
2 checks passed
@stefanoverna stefanoverna deleted the datoid-to-uuid branch March 26, 2024 10:21
@arcataroger
Copy link
Member Author

arcataroger commented Mar 26, 2024

Thanks for the changes @stefanoverna! I also didn't realize you could just forcibly rewrite the commit history like that (instead of adding to it)... 👀

Every year I use Git, I understand it a little less, lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants