Category : crc16

How to convert this backend code to javascript? my inputs are hex data without (0x) in one sentence like this one ("c01fgh8751") is equivalent of 0xc0 0x1f 0xgh 0x87 0x51 Right data: input1 = c0a80ae7534d415254434c4f5544aaaa0F03FEFFFE0031015505000001 crc = 91D8 input2 = c0a80ae7534d415254434c4f5544aaaa0F03FEFFFE0031015505640001 crc = D673 https://gist.github.com/chitchcock/5112270 this code does not help C code from docs This ..

Read more

I need to convert this c language code to JavaScript function. How to calculate CRC-16 for Dex protocol I had read https://community.st.com/s/question/0D50X00009XkZDkSAN/crc16-calculation #include <stdio.h> void calc_crc(unsigned int *pCrc, unsigned char uData) { int iBit; for (iBit = 0;iBit<8;iBit++,uData>>=1) { if((uData^*pCrc)&0x01) { *pCrc>>=1; *pCrc^=0xA001; } else *pCrc>>=1; } } Source: Ask Javascript..

Read more