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

Function GetRandomToken

tools/commom.go:28–32  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

26}
27
28func GetRandomToken(length int) string {
29 r := make([]byte, length)
30 io.ReadFull(rand.Reader, r)
31 return base64.URLEncoding.EncodeToString(r)
32}
33
34func CreateSessionId(sessionId string) string {
35 return SessionPrefix + sessionId

Callers 2

RegisterMethod · 0.92
LoginMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected