471,607 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,607 software developers and data experts.

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 4071
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
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.