(passwordLength uint)
| 35 | } |
| 36 | |
| 37 | func RandomPwd(passwordLength uint) (string, error) { |
| 38 | randomPasswordBytes := make([]byte, passwordLength) |
| 39 | var _, err = rand.Read(randomPasswordBytes) |
| 40 | if err != nil { |
| 41 | return "", err |
| 42 | } |
| 43 | |
| 44 | // This is done purely to make the password human-readable |
| 45 | var randomPasswordString = base64.URLEncoding.EncodeToString(randomPasswordBytes) |
| 46 | return randomPasswordString, nil |
| 47 | } |
no outgoing calls
no test coverage detected