def from_hex(cls, hexed: str, context: Context = GLOBAL_CONTEXT): """ :param hexed: The private key encoded as a hex string. :param context: :return: The private key. :rtype: PrivateKey """ return PrivateKey(hex_to_bytes(hexed), context)
def from_hex(cls, hexed, context=GLOBAL_CONTEXT): return PrivateKey(hex_to_bytes(hexed), context)
def test_bytes_hex_conversion(): bytestr = b'\x00' + urandom(31) assert hex_to_bytes(bytes_to_hex(bytestr)) == bytestr