import std/[random, sets], nimcrypto/[utils, sysrand] type RandGen*[T] = object minVal, maxVal: T KVPair* = ref object key*: seq[byte] value*: seq[byte] proc randGen*[T](minVal, maxVal: T): RandGen[T] = doAssert(minVal <= maxVal) result.minVal = minVal result.maxVal = maxVal proc randGen*[T](minMax: T): RandGen[T] = randGen(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..