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

feat(crypto): add uuidv5 #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SkalaNetworks
Copy link

This pull request adds a new UUID function: uuidv5

UUIDv5 is different from the already implemented UUIDv4 functions because it is pseudo-random and deterministic.
It takes into input a "namespace", which we could call a seed of some sort. It then takes a "name" and outputs a UUID.

This feature is extremely useful for tools like Helm which depend on Sprig because of the determinism.
There are usecases where Helm Charts need to generate random IDs, but uuidv4 doesn't survive upgrades because they get regenerated.

Having one single manually generated source of randomness (the namespace) and then using it everywhere in templates by specifying different "names" makes the UUID generation random for each template but also deterministic (it will survive through upgrades).

Considering the amount of questions on stackoverflow considering idempotence for randomly generated values, I think this function would be pretty useful.

@mattfarina considering you're a Helm maintainer, do you have a particular opinion on this matter?

Signed-off-by: SkalaNetworks <[email protected]>
@SkalaNetworks
Copy link
Author

Hey @mattfarina, just paging you to know if you guys need help with maintaining this project? It's an elementary dependency of many projects and keeping it active would be beneficial for everybody. I see there was a lack of activity for almost 2 years until now, I can volunteer to keep it going.

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

Successfully merging this pull request may close these issues.

1 participant