Skip to content

Utils ‐ Password

Dynesshely edited this page Mar 24, 2024 · 1 revision

About

This is a class provides ability to generate random password.

Usage

You can call it like this:

var pwd = Password.GeneratePassword(length: 12);

Cli Tool

You can use it also in our cli tool cbt:

$ cbt pwd --help
Common.BasicHelper.Cli 0.1.6863.950+8b01c11c384856b3a1ffbf64e6424adf3e187ed8
Copyright (C) Crequency 2024

  -g, --generate               (Default: true) Generate a password.

  -l, --length                 (Default: 12) Length of the password.

  -r, --length-range           Length range of the password, like `3,5`.

  -u, --ignore-uppercase       Ignore uppercase letters.

  -e, --ignore-lowercase       Ignore lowercase letters.

  -n, --ignore-numbers         Ignore numbers.

  -s, --ignore-symbols         Ignore symbols.

  -U, --supported-uppercase    (Default: ABCDEFGHIJKLMNOPQRSTUVWXYZ) Supported uppercase letters.

  -E, --supported-lowercase    (Default: abcdefghijklmnopqrstuvwxyz) Supported lowercase letters.

  -N, --supported-numbers      (Default: 0123456789) Supported numbers.

  -S, --supported-symbols      (Default: !@#$%^&*()_+-=[]{};':,./<>?) Supported symbols.

  --verbose                    Display verbose output.

  --dry-run                    Dry run the command.

  --help                       Display this help screen.

  --version                    Display version information.
$ cbt pwd -l 20
DN2$Wu+8q)8H9o71Kn0Y

Source

Source code: https://github.com/Crequency/Common.BasicHelper/blob/main/Common.BasicHelper/Utils/Password.cs

Source code preview

Clone this wiki locally