Click here to Skip to main content
16,015,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a problem, i need to generate a hash code of length 5 characters
but the input is 10 digit number. The hash code should be unique .
if any one can kindly post a solution that would be great.
Posted

1 solution

One possible solution is to take each pair of numbers and turn it into a single character. As you'll have 100 characters to choose from, you'll end up using letters, numbers, and punctuation marks. There's no way to make a unique 5 character hash for every 10 digit number without including those characters, there's just not enough characters there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900