1
2
3
4
5
6
7 package maps
8
9 import (
10 "unsafe"
11 )
12
13 const memHashAESImplemented = true
14
15 func MemHash(p unsafe.Pointer, h, s uintptr) uintptr {
16 if UseAeshash {
17 return memHashAES(p, h, s)
18 }
19 return memHashFallback(p, h, s)
20 }
21
22 func MemHash32(k uint32, h uintptr) uintptr {
23 if UseAeshash {
24 return memHash32AES(k, h)
25 }
26 return memHash32Fallback(k, h)
27 }
28
29 func MemHash64(k uint64, h uintptr) uintptr {
30 if UseAeshash {
31 return memHash64AES(k, h)
32 }
33 return memHash64Fallback(k, h)
34 }
35
36 func StrHash(s string, h uintptr) uintptr {
37 return MemHash(unsafe.Pointer(unsafe.StringData(s)), h, uintptr(len(s)))
38 }
39
View as plain text