MCPcopy Create free account
hub / github.com/ddev/ddev / RandString

Function RandString

pkg/util/utils.go:186–192  ·  view source on GitHub ↗

RandString returns a random string of given length n.

(n int)

Source from the content-addressed store, hash-verified

184
185// RandString returns a random string of given length n.
186func RandString(n int) string {
187 b := make([]byte, n)
188 for i := range b {
189 b[i] = letterBytes[rand.Intn(len(letterBytes))]
190 }
191 return string(b)
192}
193
194// HashSalt returns a hash of the projectName to be used as a salt.
195// This is appropriate only for development work, but means

Callers 15

TestNewConfigFunction · 0.92
TestAllowedAppTypesFunction · 0.92
TestHostNameFunction · 0.92
TestConfigCommandFunction · 0.92
NewWordpressConfigFunction · 0.92
TestDdevAllDatabasesFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestNewConfigFunction · 0.74
TestAllowedAppTypesFunction · 0.74
TestHostNameFunction · 0.74
TestConfigCommandFunction · 0.74
TestDdevAllDatabasesFunction · 0.74
startAndCheckUpsunPushFunction · 0.74
TestContainerWaitFunction · 0.74