/var/opt/nydus/ops/oscrypto
NameSizeModeActions
_linux_bsd/-0755rm
_mac/-0755rm
_openssl/-0755rm
_win/-0755rm
__pycache__/-0755rm
asymmetric.py131420644editdlrm
errors.py19120644editdlrm
kdf.py73460644editdlrm
keys.py5420644editdlrm
symmetric.py18400644editdlrm
tls.py5020644editdlrm
trust_list.py133130644editdlrm
util.py13310644editdlrm
version.py1520644editdlrm
_asn1.py19590644editdlrm
_asymmetric.py309120644editdlrm
_cipher_suites.py180690644editdlrm
_ecdsa.py228180644editdlrm
_errors.py10210644editdlrm
_ffi.py121020644editdlrm
_int.py6660644editdlrm
_pkcs1.py203170644editdlrm
_pkcs5.py34130644editdlrm
_pkcs12.py48760644editdlrm
_rand.py10400644editdlrm
_tls.py178450644editdlrm
_types.py8720644editdlrm
__init__.py97540644editdlrm
Edit: /var/opt/nydus/ops/oscrypto/_rand.py (1040B)
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import os from ._errors import pretty_message from ._types import type_name, int_types __all__ = [ 'rand_bytes', ] def rand_bytes(length): """ Returns a number of random bytes suitable for cryptographic purposes :param length: The desired number of bytes :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters are of the wrong type OSError - when an error is returned by OpenSSL :return: A byte string """ if not isinstance(length, int_types): raise TypeError(pretty_message( ''' length must be an integer, not %s ''', type_name(length) )) if length < 1: raise ValueError('length must be greater than 0') if length > 1024: raise ValueError('length must not be greater than 1024') return os.urandom(length)