2020-07-05 01:44:00 +03:00
|
|
|
import os
|
|
|
|
import os.cmdline
|
|
|
|
import crypto.rand
|
|
|
|
import strings
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
blocksize := 256
|
|
|
|
size := cmdline.option(os.args, '-size', '80').int()
|
|
|
|
repeats := cmdline.option(os.args, '-repeats', '4').int()
|
|
|
|
for _ in 0 .. repeats {
|
|
|
|
mut sb := strings.new_builder(blocksize)
|
|
|
|
for {
|
2021-02-23 20:43:44 +03:00
|
|
|
x := rand.read(blocksize) ?
|
2020-07-05 01:44:00 +03:00
|
|
|
for c in x {
|
|
|
|
if c >= `0` && c <= `~` {
|
2022-01-28 21:34:44 +03:00
|
|
|
sb.write_byte(c)
|
2020-07-05 01:44:00 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if sb.len > size {
|
|
|
|
println(sb.str()[0..size])
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|