You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
random % alphabet is a popular mistake [...] [t]he distribution will not be even; there will be a lower chance for some symbols to appear compared to others.
The text was updated successfully, but these errors were encountered:
I opened this issue because I considered doing a 1:1 algorithm translation in a new repo but I think it would be better to update this project instead of creating a new one.
Describe the bug
I am unsure if this implementation is the same algorithm as the original.
To Reproduce
The entropy is computed differently:
https://github.com/paralleldrive/cuid2/blob/53e246b0919c8123e492e6b6bbab41fe66f4b462/src/index.js#L7-L14
cuid-java/src/main/java/io/github/thibaultmeyer/cuid/CUID.java
Lines 265 to 275 in c55aa79
The hash is computed differently:
https://github.com/paralleldrive/cuid2/blob/53e246b0919c8123e492e6b6bbab41fe66f4b462/src/index.js#L31-L35
cuid-java/src/main/java/io/github/thibaultmeyer/cuid/CUID.java
Lines 283 to 292 in c55aa79
The alphabet is accessed differently:
https://github.com/paralleldrive/cuid2/blob/53e246b0919c8123e492e6b6bbab41fe66f4b462/src/index.js#L37-L39
cuid-java/src/main/java/io/github/thibaultmeyer/cuid/CUID.java
Line 69 in c55aa79
https://github.com/ai/nanoid?tab=readme-ov-file
The text was updated successfully, but these errors were encountered: