mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-03 15:47:23 -04:00
Bump libmutton & support new password generation options; bump other dependencies
This commit is contained in:
@@ -64,6 +64,22 @@ func inputMenuGen(prompt string, options []string) int {
|
||||
return inputInt(prompt, len(options))
|
||||
}
|
||||
|
||||
// inputPasswordGen prompts the user for password generation parameters and returns a generated password as a string.
|
||||
func inputPasswordGen() string {
|
||||
passLength := inputInt("Password length:", -1)
|
||||
passCharset := uint8(inputMenuGen("Password complexity:", []string{"Simple", "Complex", "Ultra Complex (not compatible with many services)"}))
|
||||
var complexity float64
|
||||
switch passCharset {
|
||||
case 1:
|
||||
complexity = 0 // simple
|
||||
// 1 indicates string gen for filenames, but since complexity is 0, only the base charset is used
|
||||
default:
|
||||
complexity = 0.2 // (ultra) complex
|
||||
// 2 and 3 indicate complex and ultra complex charsets, respectively
|
||||
}
|
||||
return core.StringGen(passLength, complexity, passCharset)
|
||||
}
|
||||
|
||||
// writeEntryCLI writes an entry to targetLocation and previews it (errors if no data is supplied).
|
||||
func writeEntryCLI(targetLocation string, unencryptedEntry []string, hideSecrets bool) {
|
||||
if core.EntryIsNotEmpty(unencryptedEntry) {
|
||||
|
||||
Reference in New Issue
Block a user