mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-24 12:07:11 -04:00
13 lines
No EOL
247 B
Python
13 lines
No EOL
247 B
Python
#!/usr/bin/env python3
|
|
#coding=utf-8
|
|
|
|
# Get Checksum 16-bit
|
|
def checksum16(data):
|
|
chk16 = 0
|
|
|
|
for idx in range(0, len(data), 2):
|
|
chk16 += int.from_bytes(data[idx:idx + 2], 'little')
|
|
|
|
chk16 &= 0xFFFF
|
|
|
|
return chk16 |