def test_modhex_encode(self): self.assertEqual('', modhex_encode(b'')) self.assertEqual('dteffuje', modhex_encode(b'\x2d\x34\x4e\x83')) self.assertEqual( 'hknhfjbrjnlnldnhcujvddbikngjrtgh', modhex_encode(b'\x69\xb6\x48\x1c\x8b\xab\xa2\xb6' b'\x0e\x8f\x22\x17\x9b\x58\xcd\x56'))
def test_modhex_encode(self): self.assertEqual("", modhex_encode(b"")) self.assertEqual("dteffuje", modhex_encode(b"\x2d\x34\x4e\x83")) self.assertEqual( "hknhfjbrjnlnldnhcujvddbikngjrtgh", modhex_encode(b"\x69\xb6\x48\x1c\x8b\xab\xa2\xb6" b"\x0e\x8f\x22\x17\x9b\x58\xcd\x56"), )
def serial_modhex(self): with self._open_device(TRANSPORT.OTP) as dev: return modhex_encode(b'\xff\x00' + struct.pack(b'>I', dev.serial))