I do not understand the problem. If you only need 100 variables why 8 characters?
A-P is 16 letters. There are 16X16=256 2 letter combinations, that's more than you need, if you want no repeated letters, 16X15=240 still more than you need. Why use more than 2 letters? 3 letters 16X16X16=4096 combinations, 16X15X14=3360 no repeats. 8 characters is has combinations in the trillions. Overkill? Bill --- In [email protected], Dennis Brown <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a problem where I need to make my static variable names unique > by appending a unique key string to them. The key is generated from > the string representing a file path. I found an algorithm that > generates a unique single precision floating point number from the > sequence of ASCII characters in the string. My problem is that I want > to generate an 8 character sequence of characters (A-P) that represent > the eight 4 bit hex characters that make up a 32 bit floating point > number. Of course if it were an integer, I would just keep dividing > by 16 to get the characters out, but a floating point number will only > give me 6 characters that way. It is late, so perhaps it is just > brain fade, but if anyone has a clue, I would appreciate the hints. > Perhaps 6 characters (23 bits) is "good enough". I am only keying a > hundred or so paths. Perhaps I should just make the key four 6 bit > characters? > > Best regards, > Dennis >
