Utilities for working with random data.
Authors: Alexander Færøy (ahf@0x90.dk
).
bytes/1 | Return N random bytes. |
bytes_unsigned/1 | Return N random bytes as an unsigned integer. |
coin_toss/0 | Toss a coin. |
hostname/4 | Return random hostname. |
pick/1 | Return a random element from a given list. |
time_range/2 | Return an UNIX epoch within Start and End. |
bytes(N) -> RandomBytes
N = non_neg_integer()
RandomBytes = binary()
Return N random bytes.
bytes_unsigned(N) -> RandomUnsigned
N = non_neg_integer()
RandomUnsigned = non_neg_integer()
Return N random bytes as an unsigned integer.
coin_toss() -> head | tail
Toss a coin.
hostname(Min, Max, Prefix, Suffix) -> inet:hostname()
Min = non_neg_integer()
Max = non_neg_integer()
Prefix = string()
Suffix = string()
Return random hostname.
pick(List) -> Element
Element = term()
List = [Element]
Return a random element from a given list.
time_range(Min, Max) -> Result
Min = non_neg_integer()
Max = non_neg_integer()
Result = non_neg_integer()
Return an UNIX epoch within Start and End.