We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I have found a duplicate using this alphabet:
KStk7TsjCQxpmvcDUnVe1Zi2gJlo3WqdPYw584BHXGrfR9MzAbaIuy60NhFELO
Using this set of alphabet, the integer 54 and 45 generates the same Sqids.
54
45
See that regardless of minimum length, the Sqids are same for 54 and 45.
Notice that UKkLWZg9DA duplicates are also generated using the default alphabet, with the numbers 63 and 123:
UKkLWZg9DA
63
123
Is this expected? What to do when we have duplicates? Am I to reshuffle the alphabet?
See it in https://sqids.org/playground.
Why is this an issue? Because the generated IDs are supposed to be unique, as said in FAQ: https://sqids.org/faq#uniqueness
The text was updated successfully, but these errors were encountered:
I apologize, I didn't notice that the seemingly same IDs are actually unique by case:
Using the default alphabet, the IDs 63 and 123 generate the following strings, notice that they are not the same by case:
UkKLWZg9DA UKkLWZg9DA
The problem I was having was that I was generating sqids for my existing MySQL table that was actually unique, but case-insensitive.
The solution to ensure that the unique table column is unique and case-sensitive.
Sorry, something went wrong.
No branches or pull requests
Hi, I have found a duplicate using this alphabet:
Using this set of alphabet, the integer
![Image](https://private-user-images.githubusercontent.com/8132015/412229082-c3d48315-b874-46c0-9810-1143e4ab5872.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTIwNzYsIm5iZiI6MTczOTY5MTc3NiwicGF0aCI6Ii84MTMyMDE1LzQxMjIyOTA4Mi1jM2Q0ODMxNS1iODc0LTQ2YzAtOTgxMC0xMTQzZTRhYjU4NzIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDc0MjU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODVlYzBjMjdmNTJiYjRmZDM1N2RjYzkzYzc1MWI1MjZlNjkyNDliYzFlNzA5ZDYyM2MwNGQ3NTIzM2EyMWQ5NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XPFfYUvbcfrPaLg9OOre6pUC5X6ftkJJ2smxQCun6P8)
54
and45
generates the same Sqids.See that regardless of minimum length, the Sqids are same for
![Image](https://private-user-images.githubusercontent.com/8132015/412229262-1eccddbe-d120-4068-a955-213e92abf06a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTIwNzYsIm5iZiI6MTczOTY5MTc3NiwicGF0aCI6Ii84MTMyMDE1LzQxMjIyOTI2Mi0xZWNjZGRiZS1kMTIwLTQwNjgtYTk1NS0yMTNlOTJhYmYwNmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDc0MjU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2VkN2VjYzNlZjg3ZjkwMjk0ZDBmMzE4M2Y3YmMxZmFiOWJmODMxYmFjNDI3YjU1MDg4YWVjZTI4ZmU3ODRiZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.6nC_lK_lNA66jxNIVjFt-rl9D97DJdBxrPoBJIvq5F0)
54
and45
.Notice that
![Image](https://private-user-images.githubusercontent.com/8132015/412232533-00b78504-3baf-487e-83c7-a392b7a3f855.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTIwNzYsIm5iZiI6MTczOTY5MTc3NiwicGF0aCI6Ii84MTMyMDE1LzQxMjIzMjUzMy0wMGI3ODUwNC0zYmFmLTQ4N2UtODNjNy1hMzkyYjdhM2Y4NTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDc0MjU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWVmNzVmY2E0YzdkOWI4MGJlZTQxYzlhYTA1MDU5ZDA2NDNiMDUxOWUyOTI4YTlmMTgwOThjNzI1Mjg4ZjFmNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.foVNukO7ecn51I2kPYHX5oAG61ibo7nrpiWL2Yk0Mog)
UKkLWZg9DA
duplicates are also generated using the default alphabet, with the numbers63
and123
:Is this expected? What to do when we have duplicates? Am I to reshuffle the alphabet?
See it in https://sqids.org/playground.
Why is this an issue? Because the generated IDs are supposed to be unique, as said in FAQ:
![Image](https://private-user-images.githubusercontent.com/8132015/412233498-fed6840b-e513-4ca8-a63e-d3e8ff42b467.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2OTIwNzYsIm5iZiI6MTczOTY5MTc3NiwicGF0aCI6Ii84MTMyMDE1LzQxMjIzMzQ5OC1mZWQ2ODQwYi1lNTEzLTRjYTgtYTYzZS1kM2U4ZmY0MmI0NjcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDc0MjU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Zjk1YWIxZTBjNDgxYjcxMDJlZWU3MTEwMzFkZmE1YTFhZjIzMTEyNzVjMzcxODVmOTY2MDI5ZWE1ZWVhOGIyNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.XNfqAzUFWYJO25ZV_spOzw86cHpWXY9061TgT-ozb5M)
https://sqids.org/faq#uniqueness
The text was updated successfully, but these errors were encountered: