NotQwerty123 v2.0.0 NotQwerty123.RandomPassword

Module to generate random passwords.

Users are often advised to use random passwords for authentication. However, creating truly random passwords is difficult for people to do well and is something that computers are usually better at.

This module provides the gen_password function, which generates a random password.

Summary

Functions

Generate a random password

Functions

gen_password(opts \\ [])

Generate a random password.

Options

There are two options:

  • length - length of the password, in characters

    • the default is 8
    • the minimum length is 6
  • characters - the character set - :letters, :letters_digits or :letters_digits_punc

    • the default is :letters_digits, which will use letters and digits in the password
    • :digits will only use digits
    • :letters will use uppercase and lowercase letters
    • :letters_digits_punc will use letters, digits and punctuation characters