<--previous | contents | next-->

arc4random

The arc4random module allows the user to generate a specified amount of random information. See arc4random(3) for more information.

Example

The following example retrieves 1024 bytes of random information.

import openbsd x = openbsd.arc4random.getbytes(1024)

Interface

getbytes(bytes)

The arc4random random module exposes a single function, taking one argument - the number of bytes of data to be generated. The data is returned as a Python string.


<--previous | contents | next--> (12/21/04)
PyOpenbsd v0.1 Manual