checksum.go 134 B

123456789
  1. package checksum
  2. func Xor(buf []byte, len int) byte {
  3. temp := buf[0]
  4. for i := 1; i < len; i++ {
  5. temp ^= buf[i]
  6. }
  7. return temp
  8. }