random.password

Generates a random password.

Note

The result is generated using the cryptographically secure random number generator.

Includes letters (ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz), and if the length is greater than 4, at least one digit (0123456789) and a special character (*@.-!_%+).

Warning

After evaluation, the codebook is saved to the disk. Therefore, the generated password will also be stored.

Syntax

password(lengthOrOptions?)

Parameters

Return value

A string containing a random password.

Example

random.password()
"BUR89OvlnG*t%dF6Nmf!p_geQ"
random.password(18)
"t1mI4-QqgqZR7+M6ft"
random.password({ bits: 256 })
"HggNrziEha4LfPrvW9z68kMgfEdpS2hvb!YsBQmMYcaSNb"