Possible Duplicate:
How do I create a HashCode in .net (c#) for a string that is safe to store in a database?
I use C# 4.0 and gets the string hash by invoking:
"my string".GetHashCode()
Code generated by this call is stored into database to future use. This hash code is used to find some subset of strings and then to equal comparison.
Questions are:
- Is it a standardized hash calculation? May I assume that it is possible to calculate the same hash in different environments like C# in .Net 3.0 or future .Net editions?
- Is it possible to calculate the same hash function on yourself by writing it in Java, PL/SQL, Ruby, etc?
- Can I assume that hash generated today will be the same tomorrow in the same environment? For example when I shutdown my computer and run the program again, or change locale, or some other settings?
- What are the limits of portability?
- I know I can do it yourself, but maybe some kind of portability is provided?