At 6:09 PM -0600 11/29/05, Roph wrote:
I just discovered that the Variant.Hash method is case-insenstive for
strings.
That's true (and intentional).
1) Fix this by making the hash function case sensitive for strings so it is
usable in case-sensitive algorithms.
They already are. String hashes are necessarily non-unique, so
you'll always have to check for collisions anyway. However, the
standard behavior for a hash function is that if x = y, then Hash(x)
= Hash(y). Since '=' for strings is case insensitive, then it's
correct (and important) that Hash for strings be the same. If you
want to handle collisions by using StrComp instead of '=', you can
still do that.
Best,
- Joe
--
Joe Strout REAL Software, Inc.
Vote for REALbasic (twice!) in the LinuxWorld Reader's Choice Awards:
http://linux.sys-con.com/general/readerschoice.htm
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|