R/C Tech Forums - View Single Post - Transponder Hack
View Single Post
Old 12-26-2023 | 11:53 AM
  #37  
Metalsoft
Suspended
iTrader: (76)
 
Joined: Jun 2009
Posts: 2,237
From: Nashville, TN
Default

Here you go. Now you can make your own and it should even work with RC4.

def calculate_checksum(data):
checksum = 0
for byte in data:
checksum = (checksum + byte) & 0xFFFFFFFF # Ensure 32-bit overflow
return checksum

# Example data from your message (excluding the 8e and 8f markers)
data = [
0x02, 0x33, 0x00, 0xcf, 0x02, 0x00, 0x00, 0x01,
0x00, 0x01, 0x04, 0xb2, 0x9b, 0x01, 0x00, 0x03,
0x04, 0x27, 0xfc, 0x70, 0x00, 0x04, 0x08, 0xe8,
0x19, 0xe6, 0xbd, 0x8a, 0x75, 0x04, 0x00, 0x05,
0x02, 0x33, 0x00, 0x06, 0x02, 0x10, 0x00, 0x08,
0x02, 0x00, 0x00, 0x81, 0x04, 0xfc, 0x05, 0x04,
0x00, 0x8f
]

# Calculate checksum
checksum_value = calculate_checksum(data)
print(f"Checksum: {checksum_value:X}")
Metalsoft is offline