Module quickrand_cache

Quick Random Number Generation With Cached Data

.

Copyright © 2017 Michael Truog

Version: 1.7.1 May 31 2017 13:58:21 ------------------------------------------------------------------------

Authors: Michael Truog (mjtruog [at] gmail (dot) com).

Description

Quick Random Number Generation With Cached Data

Data Types

options()

options() = [{cache_size, Bytes::pos_integer()}]

state()

state() = #quickrand_cache{i = non_neg_integer(), cache_size = pos_integer(), cache = binary()}

Function Index

float/0

Process dictionary cache version of quickrand:strong_float/0.

.
float/1

State cache version of quickrand:strong_float/0.

.
init/0

Initialize cached process dictionary data.

.
init/1

Initialize cached process dictionary data with options.

.
new/0

Initialize cached state data.

.
new/1

Initialize cached state data with options.

.
rand_bytes/1

Get random bytes using cached process dictionary data.

.
rand_bytes/2

Get random bytes using cached state data.

.
uniform/1

Process dictionary cache version of quickrand:strong_uniform/1.

.
uniform/2

State cache version of quickrand:strong_uniform/1.

.
uniform_range/2

Process dictionary cache version of quickrand:strong_uniform_range/2.

.
uniform_range/3

State cache version of quickrand:strong_uniform_range/2.

.

Function Details

float/0

float() -> float()

Process dictionary cache version of quickrand:strong_float/0.

float/1

float(State::state()) -> {float(), state()}

State cache version of quickrand:strong_float/0.

init/0

init() -> ok

Initialize cached process dictionary data.

init/1

init(Options::options()) -> ok

Initialize cached process dictionary data with options.

new/0

new() -> state()

Initialize cached state data.

new/1

new(Options::options()) -> state()

Initialize cached state data with options.

rand_bytes/1

rand_bytes(N::pos_integer()) -> binary()

Get random bytes using cached process dictionary data.

rand_bytes/2

rand_bytes(N::pos_integer(), State::state()) -> {binary(), state()}

Get random bytes using cached state data.

uniform/1

uniform(N::pos_integer()) -> pos_integer()

Process dictionary cache version of quickrand:strong_uniform/1.

uniform/2

uniform(N::pos_integer(), State::state()) -> {pos_integer(), state()}

State cache version of quickrand:strong_uniform/1.

uniform_range/2

uniform_range(Min::non_neg_integer(), Max::non_neg_integer()) -> non_neg_integer()

Process dictionary cache version of quickrand:strong_uniform_range/2.

uniform_range/3

uniform_range(Min::non_neg_integer(), Max::non_neg_integer(), State::state()) -> {non_neg_integer(), state()}

State cache version of quickrand:strong_uniform_range/2.


Generated by EDoc