Re: Comparing GUIDs
From: Mattias Sjögren (mattias.dont.want.spam_at_mvps.org)
Date: 05/26/04
- Next message: Patrick Steele [MVP]: "Re: How to Strong Name -AGH!!!"
- Previous message: Cor Ligthert: "Re: System.NullReferenceException Error"
- In reply to: Ben Coats: "RE: Comparing GUIDs"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 May 2004 21:15:15 +0200
>IF guid1.GetHashCode=guid2.GetHashCode THEN ....
>
>I've never had any problem with using this code.
That doesn't mean it's correct. A GUID is 128 bits of data, a hash
code only 32. So many many different GUIDs could return the same value
in theory.
Since there is an Equals method, I don't see why you would use
anything else.
Mattias
-- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
- Next message: Patrick Steele [MVP]: "Re: How to Strong Name -AGH!!!"
- Previous message: Cor Ligthert: "Re: System.NullReferenceException Error"
- In reply to: Ben Coats: "RE: Comparing GUIDs"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|