sethvargo / go-password

A Golang library for generating high-entropy random passwords similar to 1Password or LastPass.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate Password contain double quotes (") and backslash (\)

Kaustubh-pande opened this issue · comments

In most of the case password not accept double-quotes (") and backslash () but Generate password function generate these symbols.
Need to remove these from generate.go.

You can customize the list of letters, symbols, numbers, etc. Create a new generator object and alter the list of symbols to be a string of the allowed symbols (e.g. "!@#$%^&*()") and it will only generate from those symbols.

gen, err := password.NewGenerator(&password.NewGeneratorInput{
  Symbols: "PUT YOUR LIST OF SYMBOLS HERE AS A SINGLE STRING",
})
if err != nil {
  # ...
}

gen.Generate(...)

Sorry, my bad...
I used your example from README.
Just for a suggestion, you can add these in README it will be more helpful.