Como calcular CRC-16 a partir de valores HEX?

No meu código eu preciso calcular valores de 16 bits CRC-16 para os valores HEX armazenados como NSdata, abaixo é o trecho de código para calcular CRC-16 em c.

   void UpdateCRC(unsigned short int *CRC, unsigned char x)
{
  // This function uses the initial CRC value passed in the first
  // argument, then modifies it using the single character passed
  // as the second argument, according to a CRC-16 polynomial
  // Arguments:
  //   CRC -- pointer to starting CRC value
  //   x   -- new character to be processed
  // Returns:
  // The function does not return any values, but updates the variable
  // pointed to by CRC
static int const Poly = 0xA001;
int i;
bool flag;
*CRC ^= x;
for (i=0; i<8; i++)
// CRC-16 polynomial
{
  flag = ((*CRC & 1) == 1);
  *CRC = (unsigned short int)(*CRC >> 1);
  if (flag)
      *CRC ^= Poly;
  }
return; 
}

NSdata que contém os valores hexadecimais como abaixo

const char connectByteArray[] = {
    0x21,0x01,0x90,0x80,0x5F
};
NSData* data = [NSData dataWithBytes: connectByteArray length:sizeof(connectByteArray)];

questionAnswers(1)

yourAnswerToTheQuestion