def hashes(item, d):
    """ Returns d hashes / positions for the item """
    codes = []
    i = 0
    while len(codes) < d:
        codes += list(array('I', sha512(pack("I", i) + item.encode("utf8")).digest())) 
        i += 1
    return codes[:d]
dataset/ETHPy150Open gdanezis/petlib/examples/tormedian.py/hashes/original