args... still needs charset minimums (how?)

This commit is contained in:
2022-03-03 04:26:44 -05:00
parent 1cb6879786
commit 480dcd7e24
11 changed files with 254 additions and 2 deletions

View File

@@ -18,6 +18,20 @@ func (c *CharSet) Less(i, j int) (isBefore bool) {
return
}
// RandChar returns a random character from a CharSet.
func (c *CharSet) RandChar() (char Char, err error) {
var selectIdx int
if selectIdx, err = saferRandInt(len(*c) - 1); err != nil {
return
}
char = (*c)[selectIdx]
return
}
// String returns a string from a CharSet.
func (c *CharSet) String() (s string) {