Skip to content

Conversation

@carldenigma
Copy link
Contributor

@carldenigma carldenigma commented Nov 3, 2025

It's possible for the following to return false CUID.isValid(CUID.randomCUID1().toString()) the reason for this is the random number can be a small enough negative number to start the CUID's random bit with a -

There is a new test CUIDv1Test#validCreation500000 which highlights the issue, because it's random it may randomly pass, however the 500,000 loops from my testing seems to be enough to get a failure.

@thibaultmeyer thibaultmeyer merged commit 452d148 into thibaultmeyer:master Nov 3, 2025
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.

2 participants