in reply to Numeric representation of strings

BrowserUk has given you an answer with a literal and strict interpretation of "unique", and Theodore a common solution if the numbers don't need to be truly unique, just extremely unlikely to collide. Here's two more approaches:

3. If by "complicated" you mean the strings are very long, and the numbers need to be truly unique, you can compress the strings, such as with zlib.

4. If your strings repeat, you could create a lookup table that maps each string to a unique number, and then replace each occurrence of the string with that number.

Replies are listed 'Best First'.
Re^2: Numeric representation of strings
by Yona (Initiate) on Apr 26, 2014 at 15:01 UTC
    Thanks a lot for your help guys!