package random
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module RandomSource
Create cryptographically secure random data.
A bigarray.
cstruct n will create a Cstruct.t of up to n bytes
int8 () creates a random byte.
If you need the byte to be encoded as a char, consider using char () instead.
int16 () creates a random 16-bit integer (of size 2 bytes).
int32 () creates a random 32-bit integer (of size 4 bytes).
int64 () creates a random 64-bit integer (of size 8 bytes).
char () creates a byte.
int ~max () creates a random 31-bit integer between 0 and max if max is specified.
float ~max () creates a random float between 0.0 and max if max is specified.
bytes len creates len random bytes
string len creates len random bytes encoded as a string
alphanum () creates len random bytes encoded as a string
seq gen creates an infinite sequence of values created by gen.
For example, use seq int to create an infinite sequence of random integers.
list gen n creates a list of n random elements created with gen.