MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / deletionChallenge

Function deletionChallenge

app/cli/cmd/auth_delete_account.go:81–101  ·  view source on GitHub ↗

deletionChallenge generates a random string

()

Source from the content-addressed store, hash-verified

79
80// deletionChallenge generates a random string
81func deletionChallenge() string {
82 const n = 8 // desired length of the random string
83
84 b := make([]byte, n)
85 _, err := rand.Read(b)
86 if err != nil {
87 panic(err)
88 }
89
90 const letterBytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789"
91 var result string
92
93 for i := 0; i < n; i++ {
94 result += string(letterBytes[int(b[i])%len(letterBytes)])
95 if i == 3 {
96 result += "-"
97 }
98 }
99
100 return result
101}

Callers 1

confirmDeletionFunction · 0.85

Calls 1

ReadMethod · 0.65

Tested by

no test coverage detected