flopscope.

flopscope.numpy.random.bytes

fnp.random.bytes(length)[flopscope source]

Return random bytes.

Adapted from NumPy docs np.random.bytes

Arearandom
Typecustom
Cost
per-operation
Flopscope Context

Sampling; cost = numel(output).

Note.

New code should use the bytes method of a Generator instance instead; please see the random-quick-start.

Parameters

length:int

Number of random bytes.

Returns

out:bytes

String of length length.

See also

Examples

>>> flops.random.bytes(10)
b' eh\x85\x022SZ\xbf\xa4' #random