logoalt Hacker News

robrenaudyesterday at 7:10 PM1 replyview on HN

The part where he chooses his inputs to hit worst case behavior in Python's hash function.


Replies

progvalyesterday at 9:17 PM

He doesn't. Inputs are:

    M = (1 << 61) - 1
    values = [i * M for i in range(1, n + 1)]
which are effectively random from the hash function's point of view, especially with a randomized seed (the default on current versions).
show 2 replies