github.com/vc42/parquet-go@v0.0.0-20240320194221-1a9adb5f23f5/bloom/xxhash/sum64uint.go (about)

     1  package xxhash
     2  
     3  func Sum64Uint8(v uint8) uint64 {
     4  	h := prime5 + 1
     5  	h ^= uint64(v) * prime5
     6  	return avalanche(rol11(h) * prime1)
     7  }
     8  
     9  func Sum64Uint16(v uint16) uint64 {
    10  	h := prime5 + 2
    11  	h ^= uint64(v&0xFF) * prime5
    12  	h = rol11(h) * prime1
    13  	h ^= uint64(v>>8) * prime5
    14  	h = rol11(h) * prime1
    15  	return avalanche(h)
    16  }
    17  
    18  func Sum64Uint32(v uint32) uint64 {
    19  	h := prime5 + 4
    20  	h ^= uint64(v) * prime1
    21  	return avalanche(rol23(h)*prime2 + prime3)
    22  }
    23  
    24  func Sum64Uint64(v uint64) uint64 {
    25  	h := prime5 + 8
    26  	h ^= round(0, v)
    27  	return avalanche(rol27(h)*prime1 + prime4)
    28  }
    29  
    30  func Sum64Uint128(v [16]byte) uint64 {
    31  	h := prime5 + 16
    32  	h ^= round(0, u64(v[:8]))
    33  	h = rol27(h)*prime1 + prime4
    34  	h ^= round(0, u64(v[8:]))
    35  	h = rol27(h)*prime1 + prime4
    36  	return avalanche(h)
    37  }