chatgris / elixir-random

Random for Elixir.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random module for Elixir

Build Status

A Elixir wrapper for the random module of Erlang.

This is not cryptographically strong as the random module of Erlang.

Examples

iex> Random.random
0.44358461744572030838
iex> Random.random(3)
1
iex> Random.sample([1,2,3])
2
iex> Random.sample([1,2,3], 2)
[3,1]
iex> Random.shuffle([1,2,3])
[2,1,3]

About

Random for Elixir.