MCPcopy Create free account
hub / github.com/Pallinder/go-randomdata / Alphanumeric

Function Alphanumeric

random_data.go:294–302  ·  view source on GitHub ↗

Alphanumeric returns a random alphanumeric string consits of [0-9a-zA-Z].

(length int)

Source from the content-addressed store, hash-verified

292
293// Alphanumeric returns a random alphanumeric string consits of [0-9a-zA-Z].
294func Alphanumeric(length int) string {
295 list := make([]byte, length)
296
297 for i := range list {
298 list[i] = ALPHANUMERIC[privateRand.Intn(len(ALPHANUMERIC))]
299 }
300
301 return string(list)
302}
303
304func Boolean() bool {
305 nr := privateRand.Intn(2)

Callers 1

TestAlphanumericFunction · 0.85

Calls 1

IntnMethod · 0.80

Tested by 1

TestAlphanumericFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…