md5 consistent across platforms/Python versions?

Discussion in 'Python' started by Gary Robinson, Jul 15, 2003.

  1. Hi,

    I know that hash functions are often platform-dependent for efficiency
    reasons. From what I understand, this includes Python's hash(), which I have
    read is not guaranteed to return the same result across platforms or even
    across Python versions.

    Can someone tell me whether an MD5 hash using Python's MD5 library IS
    guaranteed to return the same results for the same input string, across
    platforms and Python versions?

    My limited understanding of how MD5 is normally used would seem to indicate
    that this must be the case, but it would be helpful for me to have
    confirmation, since my knowledge in this area is very limited.

    --Gary

    --
    Putting http://wecanstopspam.org in your email helps it pass through
    overzealous spam filters.

    Gary Robinson
    CEO
    Transpose, LLC

    207-942-3463
    http://www.transpose.com
    http://radio.weblogs.com/0101454
    Gary Robinson, Jul 15, 2003
    #1
    1. Advertising

  2. Gary Robinson wrote:

    > I know that hash functions are often platform-dependent for efficiency
    > reasons. From what I understand, this includes Python's hash(), which
    > I have
    > read is not guaranteed to return the same result across platforms or
    > even
    > across Python versions.


    Yes.

    > Can someone tell me whether an MD5 hash using Python's MD5 library IS
    > guaranteed to return the same results for the same input string,
    > across
    > platforms and Python versions?


    Yes.

    MD5 hashes and Python's internal hash function are unrelated.

    --
    Erik Max Francis && && http://www.alcyone.com/max/
    __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
    / \ Nine worlds I remember.
    \__/ Icelandic Edda of Snorri Sturluson
    Erik Max Francis, Jul 16, 2003
    #2
    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. Replies:
    9
    Views:
    17,052
    John Salerno
    May 8, 2006
  2. Burke Libbey
    Replies:
    1
    Views:
    953
    Burke Libbey
    Jul 20, 2007
  3. David Moss
    Replies:
    3
    Views:
    281
  4. keobox
    Replies:
    1
    Views:
    224
    Steven D'Aprano
    Sep 16, 2011
  5. Peter Woodsky

    create a md5 / md5 passwd with a salt

    Peter Woodsky, Nov 20, 2008, in forum: Ruby
    Replies:
    6
    Views:
    189
    Brian Candler
    Nov 21, 2008
Loading...

Share This Page