MCPcopy Create free account
hub / github.com/borakasmer/pwd-cli / getRandomString

Function getRandomString

cmd/root.go:296–308  ·  view source on GitHub ↗
(length int, isCapital bool)

Source from the content-addressed store, hash-verified

294}
295
296func getRandomString(length int, isCapital bool) string {
297 b := make([]rune, length)
298 for i := range b {
299 if isCapital {
300 result, _ := rand.Int(rand.Reader, big.NewInt(int64(len(letterRunes2))))
301 b[i] = letterRunes2[result.Int64()]
302 } else {
303 result, _ := rand.Int(rand.Reader, big.NewInt(int64(len(letterRunes))))
304 b[i] = letterRunes[result.Int64()]
305 }
306 }
307 return string(b)
308}
309
310func checkHasCapital(password string) bool {
311 for i := 0; i < len(password); i++ {

Callers 1

generatePasswordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected