crc16/main.go
func Checksum(data []byte) []byte {
	var crc uint16
	var out bytes.Buffer
	for _, b := range data {
		crc = ((crc << 8) & 0xffff) ^ crc16tab[((crc>>8)^uint16(b))&0x00FF]
	}

	err := binary.Write(&out, binary.LittleEndian, crc)
	if err != nil {
		panic(err)
	}

	return out.Bytes()
}
func Checksum(data []byte) []byte {
	var crc uint16
	var out bytes.Buffer
	for _, b := range data {
		crc = ((crc << 8) & 0xffff) ^ crc16tab[((crc>>8)^uint16(b))&0x00FF]
	}

	err := binary.Write(&out, binary.LittleEndian, crc)
	if err != nil {
		panic(err)
	}

	return out.Bytes()
}
// Checksum returns the 2-byte checksum for the provided data