How can I convert a non-numeric String to an Integer?
I got for instance:
String unique = "FUBAR";
What's a good way to represent the String as an Integer with no collisions e.g. "FUBAR" should always be represented as the same number and shan't collide with any other String. For instance, String a = "A"; should be represented as the Integer 1 and so on, but what is a method that does this (preferrably for all unicode strings, but in my case ASCII values could be sufficient).
intvalue, then you are looking for a hash function, of which there are many. However, there can never be a perfect one guaranteeing no collisions, since there are more possible strings than ints (pigeonhole principle).int. But if you find a reliable way, come back and name your price: data compression companies are going to love you ;-)intor do you mean "a whole number of arbitrary length"?