[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:
Quote:
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.
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.
Re: [RESOLVED] Uri.GetHashCode Unique?
Thanks, Zaccheus.
That was a good article.