in reply to Generating Unique numbers from Unique strings

I believe that if i get a 32bit integer which uniquely defines the string then the storage and comparison operations will be much faster.

That's exactly what a hash does; with the additional benefit that it deals with collisions, if they occur, automatically.

So store your strings in a hash; lookup is very fast and memory management is taken care of.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Generating Unique numbers from Unique strings