Is there a pre-written function to do this in Perl?
Yes there is. Someone asked a similar question a week ago and I suggested that they use Math::BaseCalc.
You just have to choose the characters you want to use, for instance 0..9 and A..Z give you 36 digit values, and so you could convert your base-10 ids into base-36. You could go to base-64 but then you'd have to say "uppercase g, lowercase r" which would be a net loss.
The process is reversable, just convert from base 36 back to base 10.
- another intruder with the mooring of the heat of the Perl
In reply to Re: Shorter ID Codes
by grinder
in thread Shorter ID Codes
by Micz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |