Author tim.peters
Recipients eric.smith, jdemeyer, mark.dickinson, rhettinger, sir-sigurd, tim.peters
Date 2018-09-28.04:20:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538108403.73.0.545547206417.issue34751@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps worth noting that FNV-1a works great if used as _intended_:  on a stream of unsigned bytes.  All tests except the new tuple hash test suffer no collisions; the new test suffers 14.  Nothing is needed to try to worm around nested tuple catastrophes, or to worm around mixing integers of similar magnitude but different signs.  The obvious downside:  on a 64-bit box, it's 8 times as many multiplies :-(  Here's a 64-bit version:

    Py_uhash_t t = (Py_uhash_t)y;
    for (int i = 0; i < sizeof(t); ++i) {
        x = (x ^ (t & 0xff)) * (Py_uhash_t)1099511628211ULL;
        t >>= 8;
    }
History
Date User Action Args
2018-09-28 04:20:04tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, eric.smith, jdemeyer, sir-sigurd
2018-09-28 04:20:03tim.peterssetmessageid: <1538108403.73.0.545547206417.issue34751@psf.upfronthosting.co.za>
2018-09-28 04:20:03tim.peterslinkissue34751 messages
2018-09-28 04:20:03tim.peterscreate