Sha256: 3ddb7e70a1086d06145304f7fabee0ca79f2d253cf7827960d37ffcf5d08eb95
Contents?: true
Size: 416 Bytes
Versions: 11
Compression:
Stored size: 416 Bytes
Contents
def rand_str(len) return (0...len).map { (65 + rand(26)).chr }.join end def generate_hash(widths) result = {} if widths.empty? return rand_str(20) else widths[0].times do result[rand_str(9)] = generate_hash(widths[1..widths.length]) end return result end end def generate_data_array_for_spec(spec) data = [] ITERATIONS.times do data << generate_hash(spec) end data end
Version data entries
11 entries across 11 versions & 1 rubygems