MCPcopy Create free account
hub / github.com/LockGit/gochat / GetSnowflakeId

Function GetSnowflakeId

tools/commom.go:20–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18const SessionPrefix = "sess_"
19
20func GetSnowflakeId() string {
21 //default node id eq 1,this can modify to different serverId node
22 node, _ := snowflake.NewNode(1)
23 // Generate a snowflake ID.
24 id := node.Generate().String()
25 return id
26}
27
28func GetRandomToken(length int) string {
29 r := make([]byte, length)

Callers 4

pushSingleToConnectMethod · 0.92

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected