Skip to content

Commit

Permalink
Pass bytearray to crc checksum calculator
Browse files Browse the repository at this point in the history
Closes: #12
Related: Nicoretti/crc#113
  • Loading branch information
baryluk committed Nov 15, 2023
1 parent 02aa360 commit 74c950f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fnirsi_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def decode(data, calculate_crc, time_interval):

if calculate_crc:
actual_checksum = data[-1]
expected_checksum = calculate_crc(data[1:-1])
expected_checksum = calculate_crc(bytearray(data[1:-1]))
if actual_checksum != expected_checksum:
print(
f"Ignoring packet of length {len(data)} with unexpected checksum. "
Expand Down

0 comments on commit 74c950f

Please sign in to comment.