func secdedCksum(a []byte) uint64 { var ( all = uint64(0) idx = uint64(0) i = uint64(3) ) for _, a := range a { bits := uint64(a) all ^= bits for n := 8; n >= 0; n-- { bit := bits & 1 idx ^= i & -bit bits >>= 1 i += 2 } } all ^= idx all ^= all >> 32 all ^= all >> 16 all ^= all >> 8 all ^= all >> 4 all ^= all >> 2 all ^= all >> 1 return idx<<1 + all&1 }
To receive a hint, submit unfixed code.