This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Rhamphoryncus, chemacortes, jcea, mark.dickinson, pitrou, rhettinger
Date 2009-02-12.02:08:45
SpamBayes Score 5.72545e-10
Marked as misclassified No
Message-id <1234404527.5.0.805516224345.issue5186@psf.upfronthosting.co.za>
In-reply-to
Content
[Antoine]
> Ok, updated patch:
> - uses a 4-bit rotate (not shift)
> - avoids comparing an unsigned long to -1
> - tries to streamline the win64 special path (but I can't test)

pointer_hash4.patch looks fine to me.  Still, I think it's worth
considering the simpler and faster:  x |= x>>4.  The latter doesn't
require any special-casing for various pointer sizes.  It just works.

[Adam]
> Adding an arbitrary set of OR, XOR, or add makes me uneasy;
> I know enough to do them wrong (reduce entropy), but not 
> enough to do them right.

It's easy enough to prove (just show that the function is reversible)
and easy enough to test:

   assert len(set(ids)) == len(set(map(f, set(ids)))) # for any large
group of ids
History
Date User Action Args
2009-02-12 02:08:47rhettingersetrecipients: + rhettinger, jcea, chemacortes, mark.dickinson, Rhamphoryncus, pitrou
2009-02-12 02:08:47rhettingersetmessageid: <1234404527.5.0.805516224345.issue5186@psf.upfronthosting.co.za>
2009-02-12 02:08:46rhettingerlinkissue5186 messages
2009-02-12 02:08:45rhettingercreate