Example #1
0
 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)
Example #2
0
 def from_hex(cls, hexed, context=GLOBAL_CONTEXT):
     return PrivateKey(hex_to_bytes(hexed), context)
Example #3
0
def test_bytes_hex_conversion():
    bytestr = b'\x00' + urandom(31)
    assert hex_to_bytes(bytes_to_hex(bytestr)) == bytestr