1 Star 1 Fork 0

vincent/gcutil

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
xid.go 371 Bytes
Copy Edit Raw Blame History
vincent authored 2021-12-20 15:29 . feat():同步更新 1220
package token
import (
"github.com/rs/xid"
)
type gen string
type ID struct {
S string
Machine string
PID uint16
Counter int32
}
var X gen
func (g *gen) NewID() (string, *ID) {
guid := xid.New()
id := &ID{
S: guid.String(),
Machine: string(guid.Machine()),
PID: guid.Pid(),
Counter: guid.Counter(),
}
return guid.String(), id
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/vincent78/gcutil.git
git@gitee.com:vincent78/gcutil.git
vincent78
gcutil
gcutil
v1.0.1

Search