|
-
March 14th, 2007, 04:16 AM
#1
[RESOLVED] Uri.GetHashCode Unique?
Hi,
Is the hashcode produced by the function Uri.GetHashCode unique? Can two different URIs produce the same hashcode?
A quote from Object.GetHashCode:
The default implementation of GetHashCode does not guarantee uniqueness or consistency
I would like to use the value of Uri.GetHashCode as a unique key in my DB and i have to be sure it is unique.
If you have a link to an article claiming it is unique, please refer me to it.
Thanks,
Chen.
-
March 14th, 2007, 08:13 AM
#2
Re: Uri.GetHashCode Unique?
Hash codes are generally not guaranteed to be unique.
To see why, have a look at:
http://blogs.msdn.com/tomarcher/arch...10/594204.aspx
The number of possible URLs if far bigger than the number of possible hash codes returned by the .net method.
Last edited by Zaccheus; March 14th, 2007 at 08:24 AM.
-
March 14th, 2007, 11:08 AM
#3
Re: [RESOLVED] Uri.GetHashCode Unique?
Thanks, Zaccheus.
That was a good article.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|