RE: hash() yields different results for different platforms

Discussion in 'Python' started by Kerry, Richard, Jul 12, 2006.

  1. The hash is not expected to be unique, it just provides a starting point
    for another search (usually linear ?).

    See http://en.wikipedia.org/wiki/Hash_function


    Helpfully,
    Maybe,
    Richard.




    -----Original Message-----
    From: python-list-bounces+richard.kerry=
    [mailto:python-list-bounces+richard.kerry=] On
    Behalf Of Piet van Oostrum
    Sent: 12 July 2006 10:56
    To:
    Subject: Re: hash() yields different results for different platforms

    >>>>> Grant Edwards <> (GE) wrote:


    >GE> The low 32 bits match, so perhaps you should just use that
    >GE> portion of the returned hash?


    If the hashed should be unique, 32 bits is much too low if you have
    millions of entries.
    --
    Piet van Oostrum <>
    URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
    Private email:
    --
    http://mail.python.org/mailman/listinfo/python-list
    Kerry, Richard, Jul 12, 2006
    #1
    1. Advertising

  2. Kerry, Richard

    Paul Rubin Guest

    "Kerry, Richard" <> writes:
    > The hash is not expected to be unique, it just provides a starting point
    > for another search (usually linear ?).


    The database is good at organizing indexes and searching in them. Why
    not let the database do what it's good at.
    Paul Rubin, Jul 12, 2006
    #2
    1. Advertising

  3. >>>>> "Kerry, Richard" <> (KR) wrote:

    >KR> The hash is not expected to be unique, it just provides a starting point
    >KR> for another search (usually linear ?).


    >KR> See http://en.wikipedia.org/wiki/Hash_function


    That only contains a definition of a hash function. I know what a hash
    function is. But the OP wanted to use the hash as a unique key.
    --
    Piet van Oostrum <>
    URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
    Private email:
    Piet van Oostrum, Jul 13, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Qiangning Hong
    Replies:
    12
    Views:
    704
    Grant Edwards
    Jul 12, 2006
  2. =?ISO-8859-1?Q?Bj=F8rn_Augestad?=

    double to int conversion yields strange results

    =?ISO-8859-1?Q?Bj=F8rn_Augestad?=, Feb 11, 2005, in forum: C Programming
    Replies:
    31
    Views:
    902
    Tim Rentsch
    Feb 16, 2005
  3. Dirk T. Shelley

    Converting Floats to Strings yields erratic results

    Dirk T. Shelley, Jun 7, 2011, in forum: C Programming
    Replies:
    29
    Views:
    778
    Seebs
    Jun 10, 2011
  4. Rafael Nenninger

    File System Search on an asp file yields not results

    Rafael Nenninger, Nov 1, 2004, in forum: ASP General
    Replies:
    2
    Views:
    194
    Aaron [SQL Server MVP]
    Nov 1, 2004
  5. x1
    Replies:
    11
    Views:
    265
Loading...

Share This Page