Module rand.xoroshiro128pp stdlib

rand.xoroshiro128pp
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 = 4 // u32, that is

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct XOROS128PPRNG

pub struct XOROS128PPRNG {
	buffer.PRNGBuffer
mut:
	state0 u64 = u64(0x853c49e6748fea9b) ^ seed.time_seed_64()
	state1 u64 = u64(0xda3e39cb94b95bdb) ^ seed.time_seed_64()
}

#fn (&XOROS128PPRNG) seed

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

seed seeds the XOROS128PPRNG with 4 u32 values.

#fn (&XOROS128PPRNG) u8

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

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

#fn (&XOROS128PPRNG) u16

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

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

#fn (&XOROS128PPRNG) u32

inline
fn (mut rng &XOROS128PPRNG) u32() u32

u32 returns a pseudorandom unsigned u32.

#fn (&XOROS128PPRNG) u64

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

u64 returns a pseudorandom 64-bit unsigned u64.

#fn (&XOROS128PPRNG) block_size

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

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

#fn (&XOROS128PPRNG) free

unsafe
fn (mut rng &XOROS128PPRNG) free()

free should be called when the generator is no longer needed

Interfaces

This section is empty.

Enums

This section is empty.