def murmur3_64(data: Union[bytes, bytearray], seed: int = 19820125) -> int:
    """
    Pure 64-bit Python implementation of MurmurHash3; see
    http://stackoverflow.com/questions/13305290/is-there-a-pure-python-implementation-of-murmurhash
    (plus RNC bugfixes).
     
    Args:
        data: data to hash 
        seed: seed

    Returns:
        integer hash
    """  # noqa
    m = 0xc6a4a7935bd1e995
    r = 47

    mask = 2 ** 64 - 1

    length = len(data)

    h = seed ^ ((m * length) & mask)

    offset = (length // 8) * 8
    # RNC: was /, but for Python 3 that gives float; brackets added for clarity
    for ll in range(0, offset, 8):
        k = bytes_to_long(data[ll:ll + 8])
        k = (k * m) & mask
        k ^= (k >> r) & mask
        k = (k * m) & mask
        h = (h ^ k)
        h = (h * m) & mask

    l = length & 7

    if l >= 7:
        h = (h ^ (data[offset + 6] << 48))

    if l >= 6:
        h = (h ^ (data[offset + 5] << 40))

    if l >= 5:
        h = (h ^ (data[offset + 4] << 32))

    if l >= 4:
        h = (h ^ (data[offset + 3] << 24))

    if l >= 3:
        h = (h ^ (data[offset + 2] << 16))

    if l >= 2:
        h = (h ^ (data[offset + 1] << 8))

    if l >= 1:
        h = (h ^ data[offset])
        h = (h * m) & mask

    h ^= (h >> r) & mask
    h = (h * m) & mask
    h ^= (h >> r) & mask

    return h
def murmur3_64 ( data : Union [ bytes , bytearray ] , seed : int = 19820125 ) -> int : m = 0xc6a4a7935bd1e995 r = 47 mask = 2 ** 64 - 1 length = len ( data ) h = seed ^ ( ( m * length ) & mask ) offset = ( length // 8 ) * 8 for ll in range ( 0 , offset , 8 ) : k = bytes_to_long ( data [ ll : ll + 8 ] ) k = ( k * m ) & mask k ^= ( k >> r ) & mask k = ( k * m ) & mask h = ( h ^ k ) h = ( h * m ) & mask l = length & 7 if l >= 7 : h = ( h ^ ( data [ offset + 6 ] << 48 ) ) if l >= 6 : h = ( h ^ ( data [ offset + 5 ] << 40 ) ) if l >= 5 : h = ( h ^ ( data [ offset + 4 ] << 32 ) ) if l >= 4 : h = ( h ^ ( data [ offset + 3 ] << 24 ) ) if l >= 3 : h = ( h ^ ( data [ offset + 2 ] << 16 ) ) if l >= 2 : h = ( h ^ ( data [ offset + 1 ] << 8 ) ) if l >= 1 : h = ( h ^ data [ offset ] ) h = ( h * m ) & mask h ^= ( h >> r ) & mask h = ( h * m ) & mask h ^= ( h >> r ) & mask return h
Pure 64-bit Python implementation of MurmurHash3; see
    http://stackoverflow.com/questions/13305290/is-there-a-pure-python-implementation-of-murmurhash
    (plus RNC bugfixes).
     
    Args:
        data: data to hash 
        seed: seed

    Returns:
        integer hash