char mins done; need to shuffle some error condition checks before

This commit is contained in:
2022-03-04 01:04:14 -05:00
parent 77d5271b5a
commit 1c0481824e
9 changed files with 215 additions and 16 deletions

View File

@@ -1,5 +1,8 @@
package pwgenerator
// cryptoShuffler is used to shuffle a slice in a cryptographically sane way.
type cryptoShuffler struct{}
// Char is implemented as a rune.
type Char rune
@@ -32,6 +35,8 @@ type GenOpts struct {
CountUpper uint `json:"uppers"`
// CountLower specifies how many lowercase letters (0x61 to 0x7a) should be specified at a minimum.
CountLower uint `json:"lowers"`
// CountNumbers specifies how many numbers (0x30 to 0x39) should be specified at a minimum.
CountNumbers uint `json:"numbers"`
// CountSymbols specifies how many symbols (0x21 to 0x7e) should be specified at a minimum.
CountSymbols uint `json:"symbols"`
// CountExtended specifies how many extended symbols (0x80 to 0xff) should be specified at a minimum.
@@ -50,3 +55,12 @@ type GenOpts struct {
// explicitCharset is the collection of acceptable characters as explicitly defined by the caller, if any.
explicitCharset CharSet
}
// selectFilter is used to include specified number of characters.
type selectFilter struct {
upperCounter uint
lowerCounter uint
numberCounter uint
symbolCounter uint
extendedCounter uint
}