I have a uniqueId function that generates an unique ID of a string. I use this in javascript, you can find it here (see my answer): Generate unique number based on string input in Javascript
I want to do the same the same in PHP, but the function produces mostly floats instead of unsigned ints (beyond signed int value PHP_MAX_INT
) and because of that i cannot use the PHP function dechex()
to convert it to hex. dechex()
is limited to PHP_MAX_INT value so every value above the PHP_MAX_INT
will be returned as FFFFFFFF
.
In javascript instead, when using int.toString(32), it produces a string with other letters than A..F, for example:
dh8qi9t
je38ugg
How do I achieve the same result in PHP?