generating unique integer from string
i am currently working on gcc compiler for c language.
i am having 8 Digit unique string and need to generate integer ranging 0 to 64. using gcc. Any idea would be very helpfull,thanks |
there are plenty of hashing algorithms out there, this reads an awful lot like homework thoguh, so i'm not going to link to anything you shoudl really be researching yourself. Generally you'd probably want to look at converting the string into a long number and then performing a modulus of that number to get a number in the range you want. Of course, a number between 1 and 64 can only be so unique...
|
|
Quote:
|
All times are GMT -5. The time now is 05:09 AM. |