secret

Create random secrets.


Functions

f random_bytes(length) ...

Return a string of the given length. Uses os.urandom if it can, or just pseudo-random numbers otherwise.

f secret_string(length=25) ...

Returns a random string of the given length. The string is a base64-encoded version of a set of random bytes, truncated to the given length (and without any newlines).

See the source for more information.