Use Python methods for ChkSum - speed bump.

This commit is contained in:
Markus Birth 2018-10-16 23:45:22 +02:00
parent 0c9528fd4f
commit c0ec316023
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -7,8 +7,7 @@ class ChkSum:
self.last_byte = 0xff
def add(self, data):
for c in data:
self.chksum += c
self.chksum += sum(bytearray(data))
self.last_byte = data[-1]
self.chksum &= 0xff