Backported functions from Cryptography to support older versions.

These functions can be obtained from cryptography.utils instead, from version 1.1 onwards.

Function intFromBytes Convert an integer in packed form to a Python int.
Function intToBytes Convert a Python int to packed data.
def intFromBytes(data, byteorder, signed=False): (source)

Convert an integer in packed form to a Python int.

ParametersdataThe packed integer. (type: bytes)
byteorderThe byte order the data is in. Only 'big' is currently supported. (type: str)
signedTrue for signed, False for unsigned. (type: bool)
ReturnsThe decoded integer. (type: int)
def intToBytes(integer, length=None): (source)

Convert a Python int to packed data.

ParametersintegerThe integer to pack. (type: int)
lengthThe length to pad the result to, or None for no padding. (type: int or None)
ReturnsThe packed integer. (type: bytes)
API Documentation for Twisted, generated by pydoctor at 2016-10-29 16:19:29.