realbasic-nug
[Top] [All Lists]

Doh! Variant.Hash is case insenstive Re: Variant.Hash for objects is

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Doh! Variant.Hash is case insenstive Re: Variant.Hash for objects is not unique in RB 2005 v4
From: Roph <Roph at kc dot rr dot com>
Date: Tue, 29 Nov 2005 18:09:52 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcX1QmKNoTMBWmE1Edq/mgANk0o3Jg==
Thread-topic: Doh! Variant.Hash is case insenstive Re: Variant.Hash for objects is not unique in RB 2005 v4
On 11/29/05 10:40 AM, "Joseph J. Strout" <joe at realsoftware dot com> wrote:

> OK, it's true; Variant.Hash is currently not unique, even for
> distinct objects (or integers), and it's been this way since at least
> 2003.  It's been fixed for the next release of REALbasic.
> 

Gack!

I just discovered that the Variant.Hash method is case-insenstive for
strings.

If you're going to change the code in the next beta release that will affect
the hashing algorithm then I implore you to please either:

1) Fix this by making the hash function case sensitive for strings so it is
usable in case-sensitive algorithms.  We can always lowercase a string if
that's what we want to hash one.  This will presumably speed up the hash
function as well since RB will NOT be lowercasing the string prior to
computation of a hash.

2) Provide a second function, say Variant.MixedCaseHash that does this if
you believe that changing the defintion of Variant.Hash would adversely
affect exsiting code.

3) Take an optional argument
        Variant.Hash( isCaseSensitive = false ) as Integer

or of course there's always:

4) Offer a recommendation of what other vendor such as Einhugur, MBS, etc
offer a fast, useful, case-senstivie hash function.

Thanks!
--Ed

 


_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>