MCPcopy Create free account
hub / github.com/covscript/covscript / rand_bytes

Function rand_bytes

tests/benchmark.py:132–134  ·  view source on GitHub ↗

Generate a random string of specified length

(length)

Source from the content-addressed store, hash-verified

130
131
132def rand_bytes(length):
133 """Generate a random string of specified length"""
134 return "".join(random.choice(char_pool) for _ in range(length))
135
136
137def test_string_ops(num_tests, length):

Callers 1

test_string_opsFunction · 0.85

Calls 1

rangeFunction · 0.85

Tested by 1

test_string_opsFunction · 0.68