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.26k stars 417 forks source link

Same hash for different ids #155

Closed georgecoca closed 4 years ago

georgecoca commented 4 years ago

Hi,

Is there a reason why I'm getting same hash for different numbers?

$hashids = new Hashids\Hashids('', 6);

$hash = $hashids->encode(7992);  // bmOqpe
$hash = $hashids->encode(7904); // bmOQpe

The only difference is that they are case-insensitive. Is this how it's supposed to work?

Thanks.

vinkla commented 4 years ago

The only difference is that they are case-insensitive. Is this how it's supposed to work?

Yes.

georgecoca commented 4 years ago

Alright, thanks. I suppose I need to use a lowercase alphabet in this case.