4 ms·
Would you mind slightly elucidating on that algorithm? Max.Integer would be 2^32-1 for instance? Where does the 30% parameter get exercised? I thought it was t
by renewiltord 3y ago
Would you mind slightly elucidating on that algorithm? Max.Integer would be 2^32-1 for instance? Where does the 30% parameter get exercised?
I thought it was the traditional circle point consistent hashing algo that GP was discussing but this is interesting.
- jdwyah 3y agoSure. https://github.com/prefab-cloud/prefab-cloud-java/blob/main/client/src/main/java/cloud/prefab/client/internal/HashProvider.java https://github.com/prefab-cloud/prefab-cloud-java/blob/main/... is consistent function that turns a string into a float in the range 0-1. So if you hash "flagA-user1234" you'll get a number 0-1 and if you compare that to < .3 you'll know whether they should be "in the flag". Relies on the uniformity of the hashing function.
- renewiltord 3y agoOh of course. Very reasonable. Thank you for source code link. I think I understand now.