Reputation: 125
Do you know any hashing method for a long numeric string to a shorter alphanumeric? I need to obtain a unique string of max length 10 out of 3 strings with a total of 33 digits.
Upvotes: 0
Views: 149
Reputation: 80197
You cannot map all possible length 33 decimal sequences 1:1 into length 10 alphanumeric string with reasonable alphabet size (you need alphabet size 2000: 10^33 = x^10 => x~1996
)
But for limited known set of decimal sequences - you can calculate perfect hash and represent hash values in appropriate system (for example: in 36 radix using 0..9, A..Z
chars)
Upvotes: 3