MCPcopy Create free account
hub / github.com/astercloud/aster / randomString

Function randomString

pkg/executionplan/types.go:294–302  ·  view source on GitHub ↗

randomString 生成随机字符串

(n int)

Source from the content-addressed store, hash-verified

292
293// randomString 生成随机字符串
294func randomString(n int) string {
295 const letters = "abcdefghijklmnopqrstuvwxyz0123456789"
296 b := make([]byte, n)
297 for i := range b {
298 b[i] = letters[time.Now().UnixNano()%int64(len(letters))]
299 time.Sleep(time.Nanosecond)
300 }
301 return string(b)
302}

Callers 2

generatePlanIDFunction · 0.70
generateStepIDFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected