vinkla / hashids

A small PHP library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.
https://hashids.org/php
MIT License
5.28k stars 418 forks source link

Added a failing test for custom alphabet and long salt #183

Closed cacharrin closed 2 years ago

cacharrin commented 2 years ago

PR to demostrate an error with different salt generating the same code.

It generates the same code, no matter how many 'a' you append to the salt of the last hashids instance.

Expected behavior: codes should be different (every salt should generate a different code) Note: Using short salt always generate different codes.

vinkla commented 2 years ago

It seems the test fails, I suggest use forums for questions. If you find a bug, please submit a new pull request.

cacharrin commented 2 years ago

Yes, the test failed because you asked me to add a failing test...

the test should pass, but is failing because codes generated by hashids are equal when using differente salts