How do I transform the following code into C#. My C is a little bit rusty:
short CalcCrc(char *str,int len)
{
short crc=0;
for(int i=0;i<len;i++)
crc ^= (short)((unsigned char)str[i]) << (i%9);
return crc;
}
How do I transform the following code into C#. My C is a little bit rusty:
short CalcCrc(char *str,int len)
{
short crc=0;
for(int i=0;i<len;i++)
crc ^= (short)((unsigned char)str[i]) << (i%9);
return crc;
}