-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature request: name slugs from deterministic numbers #4
Comments
That's an interesting idea. You are essentially talking about a weak pseudo-hash function. I see how it can be extended from just integers to arbitrary objects implementing It's not hard to implement. But one important caveat is that function output for a given input won't be stable between releases, because adding one new word completely alters the sequence. In other words, every change in word lists will break backward compatibility. And while it's not that bad in default generator - I can make a major release for every change in word lists - it can be a pitfall for custom generators. Anyway, I'll think about it over the next week. (If you want this feature ASAP for commercial project, contact me via gmail, I can give it a priority). In current version, you can use a simple hack to produce similar result:
Obviously, this messes with global random number generator and with ordinary |
One way of getting around this is carrying around previous word lists (maybe downloading them on demand in the style of nltk) so they can be fixed in the call. |
(An alternative I might be able to use today is either joblib.memcache on a function like |
No, I want to keep it lightweight and simple. I'll probably just add something like this:
With every word lists change, I'll make a new major release, and change version of the function accordingly, to minimize possibility of people upgrading to incompatible version. For custom generators, I'll add a warning in docs: use at your own risk. Probably only a few people, if any, will use it with custom generators. |
Hey, any updates on this feature? This is exactly what I need, a stable and deterministic way of generating human-readable names from hash values. From what I understand from this note on the bottom of this page simply locking the word list isn't enough since the order of the combinations could also change, correct? If so, is my only option to pin this library to a specific version and hope I won't have to update it in the future or is there any other viable workarounds? Thanks! |
Is it difficult to extend this algorithm to handle nonrandom inputs? E.g. something like
If unfeasible -- did you take inspiration for this concept from another project so I can bother them instead?
The text was updated successfully, but these errors were encountered: