tlslite.utils.compat module¶
Miscellaneous functions to mask Python version differences.
-
tlslite.utils.compat.
a2b_base64
(s)¶
-
tlslite.utils.compat.
a2b_hex
(s)¶
-
tlslite.utils.compat.
b2a_base64
(b)¶
-
tlslite.utils.compat.
b2a_hex
(b)¶
-
tlslite.utils.compat.
bit_length
(val)¶ Return number of bits necessary to represent an integer.
-
tlslite.utils.compat.
byte_length
(val)¶ Return number of bytes necessary to represent an integer.
-
tlslite.utils.compat.
bytes_to_int
(bytes, byteorder, *, signed=False)¶ Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.
- signed
Indicates whether two’s complement is used to represent the integer.
-
tlslite.utils.compat.
compat26Str
(x)¶
-
tlslite.utils.compat.
compatAscii2Bytes
(val)¶ Convert ASCII string to bytes.
-
tlslite.utils.compat.
compatHMAC
(x)¶ Convert bytes-like input to format acceptable for HMAC.
-
tlslite.utils.compat.
compatLong
(num)¶
-
tlslite.utils.compat.
compat_b2a
(val)¶ Convert an ASCII bytes string to string.
-
tlslite.utils.compat.
formatExceptionTrace
(e)¶ Return exception information formatted as string
-
tlslite.utils.compat.
int_to_bytes
(val, length=None, byteorder='big')¶ Return number converted to bytes
-
tlslite.utils.compat.
raw_input
(s)¶
-
tlslite.utils.compat.
readStdinBinary
()¶
-
tlslite.utils.compat.
remove_whitespace
(text)¶ Removes all whitespace from passed in string
-
tlslite.utils.compat.
time_stamp
()¶ Returns system time as a float