Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Password #371

Open
brianvoe opened this issue Dec 9, 2024 · 0 comments
Open

Better Password #371

brianvoe opened this issue Dec 9, 2024 · 0 comments

Comments

@brianvoe
Copy link
Owner

brianvoe commented Dec 9, 2024

Enough discussion has been made about making a better password function.

What i would like to do is update the function to take in a struct of fields to determine the generated string output

Types:
simple - currently what we have. options would be
words - simple to memorize words separated by dash. options would just be length
pin - length x # - default length 4 if type is set to pin and length not set

type PassConfig struct {
    Type: string
    Length: int // used by multiple
    
    // Simple Fields
    Lower: boolean
    Upper: boolean
    // etc...

    // Words/Pin - may not need other than length
}

Things to keep in mind:

  1. Performance - It doesnt have to be the fastest thing in the world but lets be tight about allocation to generate a password
  2. Separate by types - the function should switch statement between the different private password function types
  3. Struct - lets keep it flat to help with lookup field mapping
  4. Can pass in nil and will set default. This keeps it simple if people just need whatever we give
  5. Breaking change - Update everything else that uses it and PR MERGE INTO V8 BRANCH! I will be merging other breaking changes there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant