def to_hex(self): return bytes_to_hex(self.secret)
def test_bytes_hex_conversion(): bytestr = b'\x00' + urandom(31) assert hex_to_bytes(bytes_to_hex(bytestr)) == bytestr