Module rand.splitmix64 stdlib

rand.splitmix64
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 = 2

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct SplitMix64RNG

pub struct SplitMix64RNG {
	buffer.PRNGBuffer
mut:
	state      u64 = seed.time_seed_64()
	bytes_left int
	buffer     u64
}

#fn (&SplitMix64RNG) seed

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

seed sets the seed of the accepting SplitMix64RNG to the given data in little-endian format (i.e. lower 32 bits are in [0] and higher 32 bits in [1]).

#fn (&SplitMix64RNG) u8

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

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

#fn (&SplitMix64RNG) u16

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

u16 returns a pseudorandom 16bit int in range [0, 2¹⁶).

#fn (&SplitMix64RNG) u32

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

u32 returns a pseudorandom 32bit int in range [0, 2³²).

#fn (&SplitMix64RNG) u64

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

u64 returns a pseudorandom 64bit int in range [0, 2⁶⁴).

#fn (&SplitMix64RNG) block_size

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

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

#fn (&SplitMix64RNG) free

unsafe
fn (mut rng &SplitMix64RNG) free()

free should be called when the generator is no longer needed

Interfaces

This section is empty.

Enums

This section is empty.