The returned UUID length is not consistent
Mido-sys opened this issue · comments
Randomly, the generated UUID length returned using shortuuid.New()
is 21 instead of 22.
I suspect this is related to #23
Thank you so much for the speedy reply :-)
Yes, that might be the issue. Any ET when the pull request can be merged?
I have another solution in mind (basically port upstream changes from the Python library). But that means a breaking change since you wouldn't be able to decode uuids created from v3 using. So I would have to make a major version change.
An upside is that the length will be consistent and use fewer allocations (i.e. be faster).
I'm curious though what the problem you face with inconsistent string length?
@lithammer, apologies for the late reply.
We have been using v4 for a while now, and the length has been consistent. Thank you.
We're using it as a request ID, and the length wasn't correct when we tried to validate the ID. BTW, how unique are the generated UUID? We faced issues having duplicates generated.
BTW, how unique are the generated UUID? We faced issues having duplicates generated.
Hmm that's surprising given that the chance of a collision is extremely low for a UUIDv4 (which is what's used under the hood). Unless maybe the server(s) have very low entropy or something similar...?
Wikipedia contains a section about this: https://en.wikipedia.org/wiki/Universally_unique_identifier#Collisions