MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / randomUUID

Function randomUUID

internal/serverapi/users.go:654–662  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

652func isValidUUID(s string) bool { return uuidRe.MatchString(s) }
653
654func randomUUID() string {
655 buf := make([]byte, 16)
656 if _, err := rand.Read(buf); err != nil {
657 return fmt.Sprintf("pulse-%d", time.Now().UnixNano())
658 }
659 buf[6] = (buf[6] & 0x0f) | 0x40
660 buf[8] = (buf[8] & 0x3f) | 0x80
661 return fmt.Sprintf("%x-%x-%x-%x-%x", buf[0:4], buf[4:6], buf[6:8], buf[8:10], buf[10:16])
662}
663
664func randomToken(size int) string {
665 buf := make([]byte, size)

Callers 7

handleSetupMethod · 0.85
handleUsersMethod · 0.85
handleUserInboundsMethod · 0.85
handleUserCredentialsMethod · 0.85
syncUserInboundsMethod · 0.85
handleInboundUsersMethod · 0.85
syncGroupForUserMethod · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected