Skip to content
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

UUID Collision #25

Closed
djm opened this issue Aug 25, 2022 · 2 comments
Closed

UUID Collision #25

djm opened this issue Aug 25, 2022 · 2 comments

Comments

@djm
Copy link

djm commented Aug 25, 2022

Version 0.5.0

Given only 168140 rows, we're seeing 4 UUID generation collisions across the entire set even when when copycat.uuid is fed with unique-to-that-table data. Different inputs are giving the same outputs.

This occurs for us regardless of whether we use our integer IDs or prefixed-cuids as the input.

Replication:

console.log(copycat.uuid(158012))
console.log(copycat.uuid(30939))
console.log()

console.log(copycat.uuid(99754))
console.log(copycat.uuid(132262))
console.log()

console.log(copycat.uuid(46865))
console.log(copycat.uuid(102367))
console.log()

console.log(copycat.uuid(122917))
console.log(copycat.uuid(91620))
console.log()

console.log(copycat.uuid("usr_cl74n76272kyp04ujquy1beqn"))
console.log(copycat.uuid("usr_cl74n4tp512yq04ujdi321oez"))

Output:

219f19e0-b9c4-5a42-ad8a-9a80e9b246a6
219f19e0-b9c4-5a42-ad8a-9a80e9b246a6

2ce050e8-37de-5de3-9a6a-1ad1252df1f4
2ce050e8-37de-5de3-9a6a-1ad1252df1f4

4358a1c5-c43f-5cfe-963e-13b02a3621f1
4358a1c5-c43f-5cfe-963e-13b02a3621f1

bc58abc9-eb5a-5ceb-84e5-684612eb7d7b
bc58abc9-eb5a-5ceb-84e5-684612eb7d7b

1d99d2e8-3edc-5e70-9c9c-f19919872ffa
1d99d2e8-3edc-5e70-9c9c-f19919872ffa

https://replit.com/join/krqpfrimzc-darianmoody

@djm
Copy link
Author

djm commented Aug 25, 2022

This is already being investigated here actually! Closing.

@djm djm closed this as completed Aug 25, 2022
@justinvdm
Copy link
Contributor

Thanks for the ticket @djm! We've released 0.6.0, where md5 alone is being used for hashing - this should make the chance of collisions significantly lower.

If you'd like to try this out in snaplet, we've released 0.15.0, which includes the new copycat version with this change.

I know I also promised you more details about collision probabilities with copycat (months ago now!) and haven't gotten back to you yet. Still on my list, and will let you know as soon as I have more details for you!

In the meantime, could you try out the new snaplet / copycat and see how it works for you?

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

No branches or pull requests

2 participants