github.com/Psiphon-Inc/goarista@v0.0.0-20160825065156-d002785f4c67/key/hash.go (about) 1 // Copyright (C) 2016 Arista Networks, Inc. 2 // Use of this source code is governed by the Apache License 2.0 3 // that can be found in the COPYING file. 4 5 package key 6 7 import "unsafe" 8 9 //go:noescape 10 //go:linkname strhash runtime.strhash 11 func strhash(a unsafe.Pointer, h uintptr) uintptr 12 13 func _strhash(s string) uintptr { 14 return strhash(unsafe.Pointer(&s), 0) 15 } 16 17 //go:noescape 18 //go:linkname nilinterhash runtime.nilinterhash 19 func nilinterhash(a unsafe.Pointer, h uintptr) uintptr 20 21 func _nilinterhash(v interface{}) uintptr { 22 return nilinterhash(unsafe.Pointer(&v), 0) 23 }