A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-February/143379.html below:

[Python-Dev] Hash randomization for which types?

[Python-Dev] Hash randomization for which types? [Python-Dev] Hash randomization for which types?Larry Hastings larry at hastings.org
Wed Feb 17 08:29:31 EST 2016
On 02/16/2016 09:22 PM, Stephen J. Turnbull wrote:
> Glenn Linderman writes:
>
>   > I think hashes of all types have been randomized, not _just_ the list
>   > you mentioned.
>
> Yes.  There's only one hash function used, which operates on byte
> streams IIRC.  That function now has a random offset.  The details of
> hashing each type are in the serializations to byte streams.

Both these statements are wrong.  int objects have their own hash 
algorithm, built in to long_hash() in Objects/longobject.c.  The hash of 
an int is the value of the int, unless it's -1 or doesn't fit into the 
native type.  And ints don't participate in hash randomization.


//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160217/a86784de/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4