Hi, I'm trying to find out what method the VB .NET GetHashCode() function uses with the view of using the same hashing method in PHP.
Can anyone help?
Hashing
Moderator: General Moderators
Re: Hashing
I love the part in bold.
http://msdn.microsoft.com/en-us/library ... hcode.aspxThe 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.
-
stoneferry
- Forum Newbie
- Posts: 9
- Joined: Sat Feb 16, 2008 10:39 am
Re: Hashing
Thanks for the response, what does all of that actually mean? Does it mean I'm unable to create a hash in PHP?
The GetHashCode() function supposedly uses the 'Zobel/Ramakrishna' method.
The GetHashCode() function supposedly uses the 'Zobel/Ramakrishna' method.
Re: Hashing
I believe what is means is....
.NET makes me slightly nauseous.
-OmniUni
Code: Select all
While it's supposed to use the 'Zobel/Ramakrishna' method to produce a hash, it isn't implemented quite properly. However it is done, it is done the same in all the .NET stuff, so it will work fine internally. Don't however, expect to be able to reproduce the same hashes on other systems, because, as stated before, the buggy implementation yields somewhat unique results, even if it doesn't produce unique hashes.-OmniUni