I'm migrating our database from MySQL to SQL Azure and the files and services hosted with another hosting provider to Windows Azure, we had migrated the databases and the Web Service without problems, but we are saving the password of our users as hashCode,
and the hashCode varies from my previous Web Service to my new Web Service under Windows Azure, for example the hashCode of the character "1" is -842352753 consuming the Web Service without Windows Azure, and running under Windows Azure the Web Service return
the hashCode 372029325, so we cannot validate our users.
Do you know a solution to solve this issue?
I'm not doing anything with SQL Azure yet, I'm testing the Web Services getting the hashCode of a string with a method like this:
string getData(string s)
And I was consuming the Web Service in my client calling the method in the service with this code:
Then the Web Service get me the hashCode of my string, in this case "1", I didn't use databases yet.
I guess that the variation of the hashCode is due of the version of Framework or the Architecture of the OS, but I don't know if the variation is due to the Web Service is running under Windows Azure, maybe this is happening, because the hashCode returned
varies if I run the Web Service Local or I run the Web Service under Windows Azure, both are running in my Laptop.
The default implementation of the GetHashCode method does not guarantee unique return values for different objects. Furthermore, the .NET Framework does not guarantee the default implementation of the
GetHashCode method, and the value it returns will be the same between different versions of the .NET Framework. Consequently, the default implementation of this method must not be used as a unique object identifier
for hashing purposes.
The different .NET Framework can not guarantee default implementation of this method will return the same value, so i think this is not the recommended way to do that with authentication, unless you can implement this method by yourself.
I suggest you use other hash encrypt method, such as SHA-2 or MD5:
The problem is that I already have users registered with their password as hashcode and I need migrate to other platform in this case Windows Azure. Is there a way to get the hashCode as I have saved provided by my current Framework?