crc16/main.go
func Validate(data []byte, expected []byte) error {

	actual := Checksum(data)

	// validate the provided checksum against the calculated
	if !bytes.Equal(actual, expected) {
		return ErrInvalidChecksum
	}

	return nil
}
func Validate(data []byte, expected []byte) error {

	actual := Checksum(data)

	// validate the provided checksum against the calculated
	if !bytes.Equal(actual, expected) {
		return ErrInvalidChecksum
	}

	return nil
}
// Validate returns an error if the provided checksum does not match
// the calculated checksum of the provided data