feat: Add XUDP migration support

This commit is contained in:
H1JK
2023-06-07 23:03:36 +08:00
parent 093453582f
commit c3ef05b257
6 changed files with 55 additions and 25 deletions

13
common/utils/global_id.go Normal file
View 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
}