MCPcopy Create free account
hub / github.com/containerd/nerdctl / generateRandomString

Function generateRandomString

pkg/logging/logging_test.go:244–251  ·  view source on GitHub ↗

generateRandomString creates a random string of the given size.

(size int)

Source from the content-addressed store, hash-verified

242
243// generateRandomString creates a random string of the given size.
244func generateRandomString(size int) string {
245 characters := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
246 var sb strings.Builder
247 for i := 0; i < size; i++ {
248 sb.WriteByte(characters[rand.Intn(len(characters))])
249 }
250 return sb.String()
251}

Callers 1

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…