def djb2(data, seed=5381):
    """
     djb2 hash algorithm. Input: a 'bytes' object. Output: 32-bit integer. http://www.cse.yorku.ca/~oz/hash.html
     Use the hash value from the previous invocation as the seed input for the next invocation if you want to
     perform the hash in chunks-- see unit tests for example.
     """
    # https://stackoverflow.com/questions/16745387/python-32-bit-and-64-bit-integer-math-with-intentional-overflow
    hash = seed & 0XFFFFFFFF
    for d in data:
        hash = 0xFFFFFFFF & (0XFFFFFFFF & (hash * 33) + d)
    return hash