[Mono-list] Differences in GetHashCode() of Type between .NET and Mono

Hüning, Christian Christian.Huening at haw-hamburg.de
Mon Dec 8 17:03:34 UTC 2014


Thanks very much for the hint to FNV! It exactly solves my problem!

 

Von: Kornel Pal [mailto:kornelpal at gmail.com] 
Gesendet: Montag, 8. Dezember 2014 11:34
An: Hüning, Christian; mono-list at lists.ximian.com
Betreff: Re: [Mono-list] Differences in GetHashCode() of Type between .NET
and Mono

 

On 12/8/2014 9:21 AM, Hüning, Christian wrote:



I am using Mono alongside .NET in larger Deployments. Just recently I wanted
to use GetHashCode() of the type of an object to start a little algorithm on
each node, which needs to produce the same result when the same type’s
hashcode (or another equivalent information) is used. 


You might want to use 32-bit FNV-1a
(http://www.isthe.com/chongo/tech/comp/fnv/index.html) on
Type.AssemblyQualifiedName instead of GetHashCode() for this specific
purpose.

Kornel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20141208/d82f1b09/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5862 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20141208/d82f1b09/attachment.bin>


More information about the Mono-list mailing list