Module rand.musl stdlib

rand.musl
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
2
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

This section is empty.

Aliases

This section is empty.

Constants

#constant seed_len

pub const seed_len = 1

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct MuslRNG

pub struct MuslRNG {
	buffer.PRNGBuffer
mut:
	state u32 = seed.time_seed_32()
}

#fn (&MuslRNG) seed

fn (mut rng &MuslRNG) seed(seed_data []u32)

seed sets the current random state based on seed_data.

seed expects seed_data to be only one u32.

#fn (&MuslRNG) u8

inline
fn (mut rng &MuslRNG) u8() u8

byte returns a uniformly distributed pseudorandom 8-bit unsigned positive byte.

#fn (&MuslRNG) u16

inline
fn (mut rng &MuslRNG) u16() u16

u16 returns a pseudorandom 16-bit unsigned integer (u16).

#fn (&MuslRNG) u32

fn (mut rng &MuslRNG) u32() u32

u32 returns a pseudorandom 32-bit unsigned integer (u32).

#fn (&MuslRNG) u64

inline
fn (mut rng &MuslRNG) u64() u64

u64 returns a pseudorandom 64-bit unsigned integer (u64).

#fn (&MuslRNG) block_size

inline
fn (mut rng &MuslRNG) block_size() int

block_size returns the number of bits that the RNG can produce in a single iteration.

#fn (&MuslRNG) free

unsafe
fn (mut rng &MuslRNG) free()

free should be called when the generator is no longer needed

Interfaces

This section is empty.

Enums

This section is empty.