2020-07-05 00:44:00 +02: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 18:43:44 +01:00
|
|
|
x := rand.read(blocksize) ?
|
2020-07-05 00:44:00 +02:00
|
|
|
for c in x {
|
|
|
|
if c >= `0` && c <= `~` {
|
2022-01-28 19:34:44 +01:00
|
|
|
sb.write_byte(c)
|
2020-07-05 00:44:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if sb.len > size {
|
|
|
|
println(sb.str()[0..size])
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|