(This question is not about PHP type-casting.)
I have read in couple of questions what it is best not to show record id to users, but use another value, which doesn't give out any information about howmany record there is in the database, etc. I wanted to implement this, and after searching on google, surprisingly no solution was found.
So, my question is, is it possible to convert a (long, for example) sequence of strings to unique (or unique enough for at least million converts) sequence of numbers, is there any options available which I have no idea of? Just to show you an example:
$uName = $this->newUsername;
$publicId = $this->strToInt(somecomplexstring); // Outputs something like 13272992
// Or feed with username
$publicId = $this->strToInt($uName);