uds.utilities.conversions ========================= .. py:module:: uds.utilities.conversions .. autoapi-nested-parse:: Module with various conversion functions. Functions --------- .. autoapisummary:: uds.utilities.conversions.bytes_to_hex uds.utilities.conversions.bytes_to_int uds.utilities.conversions.int_to_bytes Module Contents --------------- .. py:function:: bytes_to_hex(bytes_list) Convert a list of bytes to hex string. :param bytes_list: List of bytes to convert. :return: String with provided list of bytes presented as hexadecimal values. .. py:function:: bytes_to_int(bytes_list, endianness = Endianness.BIG_ENDIAN) Convert a list of bytes to integer value. :param bytes_list: List of bytes to convert. :param endianness: Order of bytes to use. :return: The integer value represented by provided list of bytes. .. py:function:: int_to_bytes(int_value, size = None, endianness = Endianness.BIG_ENDIAN) Convert integer value to a list of bytes. :param int_value: Integer value to convert. :param size: Number of bytes in the output. Use None to use the smallest possible number of bytes. :param endianness: Order of bytes to use. :raise TypeError: At least one provided value has invalid type. :raise ValueError: At least one provided value is out of range. :raise InconsistencyError: Provided value of `size` is too small to contain entire `int_value`. :return: The value of bytes list that represents the provided integer value.