diff options
Diffstat (limited to 'helpfuncs.go')
| -rw-r--r-- | helpfuncs.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/helpfuncs.go b/helpfuncs.go index 194d68c..30d9967 100644 --- a/helpfuncs.go +++ b/helpfuncs.go @@ -9,6 +9,8 @@ import ( "path" "strings" "unicode" + + "math/rand/v2" ) func isASCII(s string) bool { @@ -239,3 +241,13 @@ func makeStatusLine() string { isRecording, persona, botPersona, injectRole) return statusLine + imageInfo + shellModeInfo } + +var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") + +func randString(n int) string { + b := make([]rune, n) + for i := range b { + b[i] = letters[rand.IntN(len(letters))] + } + return string(b) +} |
