import random, sets type RandGen*[T] = object minVal, maxVal: T Bytes* = seq[byte] proc rng*[T](minVal, maxVal: T): RandGen[T] = doAssert(minVal <= maxVal) result.minVal = minVal result.maxVal = maxVal proc rng*[T](minMax: T): RandGen[T] = rng(minMax, minMax) proc getVal*[T](x: RandGen[T]): T = if x.minVal == x.maxVal: return x.minVal rand(x.minVal..x.maxVal) proc randString*(len: int): string = result = newString(len) for i in 0..