469,133 Members | 1,127 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,133 developers. It's quick & easy.

Why does Guid.GetHashcode() returns 0 when instantiated with Guid.Empty ?

Why does Guid.GetHashcode() returns 0 when instantiated with Guid.Empty
?

Nov 30 '05 #1
2 3951
What would you expect it to return?

Guid.Empty is a 128 bit number with a value of 0. The hash code
generator for the Guid generates an integer based on the values in the 128
bit number, without offsetting the values by a constant number. This is why
it results in 0.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"csharper" <am*********@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Why does Guid.GetHashcode() returns 0 when instantiated with Guid.Empty
?

Nov 30 '05 #2
Thanks Nicholas!

Nov 30 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Fredrik Wahlgren | last post: by
9 posts views Thread by Rene | last post: by
5 posts views Thread by George | last post: by
1 post views Thread by Scott M. Lyon | last post: by
1 post views Thread by Scott M. Lyon | last post: by
1 post views Thread by Wolf | last post: by
16 posts views Thread by Mark S. | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.