How to generate unique integer from string?
.net, c#
Solution
Just take `string.GetHashCode()` which returns an `int` from a `string` with very low collision probability.
Problem
I have a few classes with heterogenous keys - int and string - and i want to work with them through common interface. It's pretty simple just convert int to string but it obviously will cause perfomance issues. Another options I see are box them to "object", which also doesn't seems perfect, or somehow generate unique integers from string (there will be no joins between former "string" and "int" so they must be unique only in "string" domain) and the quetsion here is "how"?