eddieantonio / perfection

Simple perfect hashing in Python
https://pypi.python.org/pypi/perfection
MIT License
13 stars 6 forks source link

Incorrect Psuedocode in Readme #5

Closed BANANAPEEL202 closed 2 years ago

BANANAPEEL202 commented 2 years ago

I believe the correct pseudocode for hash() is:

function hash(i):
    static r = { 2, 7, 12, 0, 7, 10 }
    static t = 6
    static z = params.offset

    i = i + z
    x = i mod t
    y = i div t
    return x + r[y]
eddieantonio commented 2 years ago

You're correct; the psuedocode in the README is missing the offset parameter.