1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

rand: move dist functions to top module and PRNG interface; minor cleanup (#14481)

This commit is contained in:
Subhomoy Haldar
2022-05-22 15:51:52 +05:30
committed by GitHub
parent 64a686f41f
commit 3647fb4def
13 changed files with 290 additions and 134 deletions

View File

@@ -4,11 +4,13 @@
module splitmix64
import rand.seed
import rand.buffer
pub const seed_len = 2
// SplitMix64RNG ported from http://xoshiro.di.unimi.it/splitmix64.c
pub struct SplitMix64RNG {
buffer.PRNGBuffer
mut:
state u64 = seed.time_seed_64()
bytes_left int