magic v0.2.0 Random

The Random provides functions that about random function

Link to this section Summary

Functions

Random generate a 16 length string

Random generate a specifc length string

Link to this section Functions

Link to this function random()
random() :: String.t

Random generate a 16 length string

Examples

iex> Random.random()
"9nNc2OaQJowEEucW"

iex> Random.random(32)
"SpMkGZ5fvapMlvA8ALG8n3YQShPm91wB"
Link to this function random(size)
random(size :: non_neg_integer) :: String.t

Random generate a specifc length string

Notes: size must be an Integer and greater than ZERO

iex> Random.random(-1)
** (ArgumentError) size must be greater than ZERO, got -1

iex> Random.random("abd")
** (ArgumentError) size must be Integer, got abd