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

[PHP 8.1] Deprecated: Implicit conversion from float-string to int loses precision #179

Closed meiyasan closed 2 years ago

meiyasan commented 2 years ago

Hello,

I have a deprecation message from PHP 8.1 : Deprecated: Implicit conversion from float-string "5914747797311690437275720" to int loses precision

It appears in case the hashids cannot be decoded. In my case, I used a message that is NOT a hashids (I haven't found a way to check this is a valid hashid but trying to decode it..) $encodedMsg = "af8ccd15-f9a9-406a-a48d-9dcc3950df06";

Sorry I am not so familiar with hashids, but I can surely help.

vinkla commented 2 years ago

Hmm, I'm not sure this is in the scope of the package. Let us know if you find a way to validate your ids.