We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0aa9470 commit f1055a1Copy full SHA for f1055a1
1 file changed
brping/pingmessage.py
@@ -193,10 +193,7 @@ def unpack_msg_data(self, msg_data):
193
194
## Calculate the checksum from the internal bytearray self.msg_data
195
def calculate_checksum(self):
196
- checksum = 0
197
- for byte in self.msg_data[0:PingMessage.headerLength + self.payload_length]:
198
- checksum += byte
199
- return checksum & 0xffff
+ return sum(self.msg_data[0:PingMessage.headerLength + self.payload_length]) & 0xffff
200
201
## Update the object checksum value
202
# @return the object checksum value
0 commit comments