in reply to Shorter ID Codes
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Shorter ID Codes
by Fletch (Bishop) on Oct 28, 2004 at 19:02 UTC | |
by Your Mother (Archbishop) on Oct 28, 2004 at 19:11 UTC |