I've been at this thing for an a few hours trying to figure it out:
data = b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF'
v = sum(struct.unpack('!%sH' % int(len(data)/2), data))
for i in range(3):
chksum += v & 0xffff
v = v >> 16
I understand what it's doing until the for i in range part. One part that gets me is this:
chksum += v & 0xffff
I'm sure v is 8 bytes, and I understand it's basically clearing bits. But it's half the size, so does it do upper or lower?
I don't know. Any help would be appreciated