realbasic-nug
[Top] [All Lists]

Re: 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: Re: 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: Wed, 30 Nov 2005 19:03:51 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcX2ExePVeM1QGIGEdq96wANk0o3Jg==
Thread-topic: Doh! Variant.Hash is case insenstive Re: Variant.Hash for objects is not unique in RB 2005 v4


On 11/30/05 6:38 PM, "Will Leshner" <will at haranbanjo dot com> wrote:

> 
> On Nov 30, 2005, at 4:11 PM, Roph wrote:
> 
>> So all we need now is a C-savvy plugin writer who wants to proclaim
>> "I can
>> name that tune in 5 minutes flat!"
> 
> 
> I wonder, though, if the Rb version wouldn't be fast enough in
> practice. 

The RB version is doing something very similar to this.  I believe it's
using a rotateCt of 5 or 6, and I'm not sure whether it's doing an add or an
xor.

Unfortunately it's case-insenstive.  I.e it's effectively returning
    yourHash = stringHash( lowerCase( yourString ) )

Which means it guarantees you will have hash collisions if you have
different cased versions of the same string.

>Are you going to be calling this millions of times a second?

No, because I doubt any processor I'm running is capable of making a million
calls per second even if it did nothing but return.  But if your asking
whether I am really planning to call this function hundreds of thousands of
times in a loop or to such a degree that the user would notice an impact in
the performance of the application, then the answer is most definitely
"yes".
  


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