MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / randomID

Function randomID

src/internal/authentication/authentication.go:508–517  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

506}
507
508func randomID(n int) string {
509 const alphanum = "ABCDEFGHJKLMNOPQRSTUVWXYZ0123456789"
510
511 var bytes = make([]byte, n)
512 rand.Read(bytes)
513 for i, b := range bytes {
514 bytes[i] = alphanum[b%byte(len(alphanum))]
515 }
516 return string(bytes)
517}
518
519func createError(errCode int) (err error) {
520 var errMsg string

Callers 1

defaultsForNewUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected