|
-
Aug 15th, 2004, 02:50 PM
#1
Thread Starter
New Member
Hashing a 10 digit number to a 2 digit alphanumeric
I need a function that does the following:
1. Takes a 10 digit number as input and creates a unique hash of that number
2. The hash should allow letters so that it can be shorter than the original number
3. The algorithm should be one-way (ie. irreversable)
4. I'm guessing by adding 26 letters (A to Z) with (0 to 9) will give 36 possibilities for each character. This means a 10 digit number can be hashed to a 2 digit alpha-numeric (?)
10^10 = 10000000000
2^36 = 68719476736
Eg. Hash(0374863796) returns A3 and no other 10 digit number (or < 10 digits) should produce A3.
Does anyone have any ideas about the algorithm to do such a thing. I've looked over the Net at hashing algs such as MD5, but it's not really suited for my purpose. I'm afraid I'm not much good at maths either...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|