I need to convert a string to a unique integer, and better it's thread safe. Is that possible? How to?

Thanks.