I have an existing application in which I made a mistake using String.GetHashCode and saving it to disk. Now, when I upgrade the application to .Net 2.0, I find that this solution has returned to bite me in the butt.
I am interested to know if anyone knows about the .NET implementation of the .NET compatible string hashing algorithm.
Obviously, the best solution would be to buy a time machine and go back to 2002, as well as hit yourself in the shin even to use the hash code in this way. Since this does not seem likely, I am looking for a workaround. I have existing users with this data in my systems, so I am not able to do one big hash conversion or something like that.
When changing to 2.0, I will update the code so that of course it uses MD5 or SHA.
I considered extracting the String.GetHashCode source from Mono, but since Mono is the GPL and my application is commercial, this is really not an option. I donβt even know if the Mono implementation is compatible with the MS.Net implementation, since the contract for GetHashCode does not require it to be compatible.
Any ideas?
source
share