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

Function panelRandomUUID

internal/panel/handler.go:109–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107}
108
109func panelRandomUUID() string {
110 buf := make([]byte, 16)
111 if _, err := rand.Read(buf); err != nil {
112 return fmt.Sprintf("pulse-%d", time.Now().UnixNano())
113 }
114 buf[6] = (buf[6] & 0x0f) | 0x40
115 buf[8] = (buf[8] & 0x3f) | 0x80
116 return fmt.Sprintf("%x-%x-%x-%x-%x", buf[0:4], buf[4:6], buf[6:8], buf[8:10], buf[10:16])
117}
118
119func panelRandomToken(size int) string {
120 buf := make([]byte, size)

Callers 2

SyncUserInboundsMethod · 0.85
apiResetTokenMethod · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected