MCPcopy Index your code
hub / github.com/python/cpython / randbytes

Method randbytes

Lib/random.py:287–289  ·  view source on GitHub ↗

Generate n random bytes.

(self, n)

Source from the content-addressed store, hash-verified

285 ## -------------------- bytes methods ---------------------
286
287 def randbytes(self, n):
288 """Generate n random bytes."""
289 return self.getrandbits(n * 8).to_bytes(n, 'little')
290
291
292 ## -------------------- integer methods -------------------

Callers 15

token_bytesFunction · 0.45
testDecompress4GMethod · 0.45
__enter__Method · 0.45
get_random_dataMethod · 0.45
test_odd_flushMethod · 0.45
testDecompress4GMethod · 0.45
test_updateMethod · 0.45

Calls 1

getrandbitsMethod · 0.45

Tested by 15

testDecompress4GMethod · 0.36
__enter__Method · 0.36
get_random_dataMethod · 0.36
test_odd_flushMethod · 0.36
testDecompress4GMethod · 0.36
test_updateMethod · 0.36
test_update_largeMethod · 0.36