A simple password generator by sup39
Find a file
2024-01-25 15:59:31 +09:00
src feat: generate password with length and charset 2024-01-25 15:51:44 +09:00
.gitignore feat: generate password with length and charset 2024-01-25 15:51:44 +09:00
Cargo.lock feat: generate password with length and charset 2024-01-25 15:51:44 +09:00
Cargo.toml feat: generate password with length and charset 2024-01-25 15:51:44 +09:00
LICENSE-APACHE feat: generate password with length and charset 2024-01-25 15:51:44 +09:00
LICENSE-MIT feat: generate password with length and charset 2024-01-25 15:51:44 +09:00
README.md doc: add advanced usage: Show and Copy to Clipboard in Wayland Environment 2024-01-25 15:59:31 +09:00

sup-randpass

A simple password generator by sup39

Usage

sup-randpass [LENGTH=36] [CHARSET...]

Charset

  • -s: space (' ')
  • -w: alphanumeric ('0'..='9', 'A'..='Z', 'a'..='z')
  • -d: numerical digits ('0'..='9')
  • -a: alphabets ('A'..='Z', 'a'..='z')
  • -u: uppercase ('A'..='Z')
  • -l: lowercase ('a'..='z')
  • --: hyphen ('-')
  • o.w.: every characters in the argument string

If no charset is specified, all ASCII printable characters (' '..='~') are used.

Examples

# generate password of length 36 containing ASCII printable characters
sup-randpass

# generate password of length 20 containing only alphanumeric characters
sup-randpass 20 -w

# generate password of length 32 containing alphanumeric characters or '+' '-' '%'
sup-randpass 20 -w +-%

Advanced Usage

Show and Copy to Clipboard in Wayland Environment

Assume you have wl-copy installed. Add the following line to your rc file:

sup-randpass() {
  command sup-randpass "$@" | tee >(wl-copy); echo
}

Source your rc file and generate password with the same command and arguments as before.