R
rh
hi all,
msdn says:
"the implementation of GetHashCode provided by the String class
returns unique hash codes for unique string values."
source:
http://msdn.microsoft.com/library/d...ml/frlrfsystemobjectclassgethashcodetopic.asp
sure, hashes must try to yield good distribution but
how could uniqueness be guarranteed in this case?
is it best effort? is it under certain conditions?
GetHashCode returns an int and so it is limited to a 32-bit
number. that's a big number but there are infinite
varieties of strings. just imagine a, aa, aaa, aaaa, aaaaa,
ad infinitum. and that's just using the letter 'a'.
thanks in advance for clarification,
rh
msdn says:
"the implementation of GetHashCode provided by the String class
returns unique hash codes for unique string values."
source:
http://msdn.microsoft.com/library/d...ml/frlrfsystemobjectclassgethashcodetopic.asp
sure, hashes must try to yield good distribution but
how could uniqueness be guarranteed in this case?
is it best effort? is it under certain conditions?
GetHashCode returns an int and so it is limited to a 32-bit
number. that's a big number but there are infinite
varieties of strings. just imagine a, aa, aaa, aaaa, aaaaa,
ad infinitum. and that's just using the letter 'a'.
thanks in advance for clarification,
rh