realbasic-nug
[Top] [All Lists]

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

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Doh! Variant.Hash is case insenstive Re: Variant.Hash for objects is not unique in RB 2005 v4
From: Thomas Tempelmann <tempelmann at gmail dot com>
Date: Wed, 30 Nov 2005 21:40:54 +0100
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nFWcox+cZlEpKU8WVmiR+lXN+Ln+2LXyUktR0aTZ7c1DR/dAzL763STUVMhghFtbmPAnYlX3L7Ua0asJY2Oi0dwrcIDXcu4nHxx06HfGm16XR1DafMAfWjHCZrNO0tazYZg/Uw2ZPI2slXzGVc1b40FObrEn0O1rmkeyQ1BWdMA=
References: <a06200701bfb372282d7f at 10 dot 0 dot 1 dot 4> <BFB32752 dot 5BD3%Roph at kc dot rr dot com>
On 11/30/05, Roph <Roph at kc dot rr dot com> wrote:
> there's a difference in having a case-senstive hash so
> that it is highly unlikely that you have to ever incur the processing
> overhead for dealing with a collision, and having a case-insensitive hash
> that guarantees you'll have to invoke your hash collision logic frequently
> and repeatedly because all uses of "text", "TEXT", and "Text" will
> necessarily hash to the same value.

I agree with Joe here - you'll have to deal with collisions anyways,
and having case-sensitive hashes only changes the performance.

HOWEVER - where this really hurts is if you try to use a RB's
Dictionary class, which builds upon these Hash values. While a
Dictionary does manage collisions and creates a list of colliding but
different keys, it will not see case-only-different strings as
different strings.

So, if you try to store two keys "a" and "A" in a dictionary, you're
not getting it done without extra work, and the solution to this
really awkward. I.e, some here suggest that you could encode your keys
as Base64 so that you can store them like case-sensitive strings. But
THAT is a big hit in performance that's way worse than what you have
to face if you're dealing with your Hash values, I'd say.

Many have complained about this, but still there's no RB-provided way
to use binary string keys without such a unnecessary performance hit.
And here, I agree fully with your perception of how the replies from
RS sound to you: If RS sees not need for it, then their users' need
can't be real, either.

--
Thomas Tempelmann - exaggerating over a million times a day!
http://www.tempel.org/rb/  -- The primary source of outdated REALbasic
plugins and examples
_______________________________________________
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>