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

rand: reorganize: phase 2

This commit is contained in:
Hungry Blue Dev
2020-06-09 18:36:07 +05:30
committed by GitHub
parent 67fcce2d46
commit e649cf84e3
28 changed files with 603 additions and 408 deletions

View File

@ -12,11 +12,11 @@ fn main() {
println('Generating $sample_size strings between $min_str_len - $max_str_len chars long...')
mut bytepile := []byte{}
for _ in 0 .. sample_size * max_str_len {
bytepile << byte(40 + rand.next(125 - 40))
bytepile << byte(rand.int_in_range(40, 125))
}
mut str_lens := []int{}
for _ in 0 .. sample_size {
str_lens << min_str_len + rand.next(max_str_len - min_str_len)
str_lens << rand.int_in_range(min_str_len, max_str_len)
}
println('Hashing each of the generated strings...')
t0 := time.ticks()