Пример #1
0
    def test_lrc(self):
        test_data = 'this is a test'

        assert lrc(test_data) == py_lrc(test_data)
Пример #2
0
 def set_checksum(self, payload):
     self._checksum = lrc(repr(self), lrc(payload))
     self._repr = None
Пример #3
0
 def valid(self):
     return lrc(self.data) == 0
Пример #4
0
 def verify_checksum(self):
     checksum = lrc(self.__header, lrc(self.__data))
     self.__isValid = checksum == 0
Пример #5
0
 def calculate_checksum(self):
     checksum = lrc(self.__header[:OFFSET_P_CHECKSUM_LOW])
     checksum = lrc(self.__header[OFFSET_P_CHECKSUM_HIGH:], checksum)
     checksum = lrc(self.__data, checksum)
     return checksum
    def test_lrc(self):
        test_data = 'this is a test'

        assert lrc(test_data) == py_lrc(test_data)
Пример #7
0
 def valid(self):
     return lrc(self.data) == 0
Пример #8
0
 def set_checksum(self, payload):
     self._checksum = lrc(repr(self), lrc(payload))
     self._repr = None