feat: Add XUDP migration support
This commit is contained in:
13
common/utils/global_id.go
Normal file
13
common/utils/global_id.go
Normal file
@ -0,0 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"hash/maphash"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var globalSeed = maphash.MakeSeed()
|
||||
|
||||
func GlobalID(material string) (id [8]byte) {
|
||||
*(*uint64)(unsafe.Pointer(&id[0])) = maphash.String(globalSeed, material)
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user