RandomPassword (random_password v1.2.1)

Random Password generator.

RandomPassword creates a module for randomly generating strings with a specified number of alpha, decimal and symbol characters. Symbols can be optionally specified.

Summary

Functions

Bits of entropy for password with alpha alpha chars, decimal decimal digits and symbol symbol chars.

Functions

entropy_bits(alpha, decimal, symbol, options \\ %{})

@spec entropy_bits(non_neg_integer(), non_neg_integer(), non_neg_integer(), map()) ::
  float()

Bits of entropy for password with alpha alpha chars, decimal decimal digits and symbol symbol chars.

This function provides calculation of entropy bits without having to create a module.

The characters to be used for alphas, decimals and symbols can be specified as options; o/w defaults are used.

Example

iex> RandomPassword.entropy_bits(12, 4, 2) |> Float.round(2)
91.31

iex> RandomPassword.entropy_bits(12, 4, 2, symbols: "!@#$%&") |> Float.round(2)
86.86