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

gmp_mod Argument #1 ($num1) is not an integer string #201

Closed sts-ryan-holton closed 7 months ago

sts-ryan-holton commented 7 months ago

I'm using the latest version of Hashids in my Laravel 11 project running PHP 8.3 and have stumbled upon an issue, given the following, which is a numeric string:

(new Hashids('', 7))->encode('09009956789098')

An error is produced:

gmp_mod(): Argument #1 ($num1) is not an integer string

I have GMP installed via PHP on the server. What are the workarounds for this please?

vinkla commented 7 months ago

Please use a forum instead.

sts-ryan-holton commented 7 months ago

Posted at https://stackoverflow.com/questions/78371967/gmp-mod-argument-1-num1-is-not-an-integer-string-hashids-package

sts-ryan-holton commented 7 months ago

@vinkla What do you suggest? This didn't happen in older versions of Hashids. If my string doesn't start with a zero then there's no issue.