:py:mod:`cryptnoxpy.binary_utils` ================================= .. py:module:: cryptnoxpy.binary_utils .. autoapi-nested-parse:: Utility module for handling binary data Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: cryptnoxpy.binary_utils.list_to_hexadecimal cryptnoxpy.binary_utils.hexadecimal_to_list cryptnoxpy.binary_utils.path_to_bytes cryptnoxpy.binary_utils.binary_to_list cryptnoxpy.binary_utils.pad_data cryptnoxpy.binary_utils.remove_padding .. py:function:: list_to_hexadecimal(data: List[int], sep: str = '') -> str Convert list of integers into hexadecimal representation :param List[int] data: List of integer to return in hexadecimal string form :param str sep: (optional) Separator to use to join the hexadecimal numbers :return: list :rtype: str .. py:function:: hexadecimal_to_list(value: str) -> List[int] Convert given string containing hexadecimal representation of numbers into list of integers :param string value: String containing hexadecimal numbers :return: List of hexadecimal values in integer form :rtype: List[int] .. py:function:: path_to_bytes(path_str: str) -> bytes Convert given path for format that the card uses :param str path_str: path to convert :return: path formatted for use with the card. :rtype: bytes .. py:function:: binary_to_list(data: bytes) -> List[int] Convert given binary data to it's representation as a list of hexadecimal values. :param bytes data: Binary data to convert to :return: List containing data in hexadecimal numbers in integer format :rtype: List[int] .. py:function:: pad_data(data: bytes) -> bytes Pad data with 0s to be length of 128. :param data: Data to be padded. :return: Data padded with 0s with length 128. :rtype: bytes .. py:function:: remove_padding(data: bytes) -> bytes Remove padding from the data :param bytes data: Data from which to remove padding :return: Data without the padding :rtype: bytes