in reply to Algoritm for converting string to number?

Well, yes, and no.

Here's the no answer: Integers are typically 32 or 64 bit characters, giving you the ability to uniquely map 232 or 264 strings. That is, if you limit yourself to Latin-1 strings, strings 4 or 8 characters long. A few characters more if your strings contain only letters and digits. Less characters if your strings use the full Unicode range.

Here's the yes answer: Use a database table, with two columns: a string field, and an integer field (autoincrementing). Use this to map the strings to (unique) integers.

  • Comment on Re: Algoritm for converting string to number?