crc16

How to configure calculation of CRC table

China☆狼群 提交于 2019-11-29 05:09:58
There are a lot of CRC calculation examples out there. Simple implementations with bit shifting and more efficient with a pre-calculated table. But there are also a lot of Parameters of a CRC beside the polynomial that affect the calculation. You can evaluate these parameters here: http://zorc.breitbandkatze.de/crc.html These parameters are initial value of CRC reflection of input data reflection of output data final XOR value for CRC For some "standard" CRC algorithm these parameters are well defined, like CRC-16 (CCITT). But there are some implementations that use different parameters. My

crc16 implementation java

寵の児 提交于 2019-11-28 11:32:26
I am having problems with calculating CRC-16 implementation of a byte array in java. Basically I am trying to send bytes to a RFID that starts writing to a tag. I can see the checksum value of array by looking tcpdump command on mac. But my goal is to generate it by myself. Here is my byte array which should generate 0xbe,0xd9: byte[] bytes = new byte[]{(byte) 0x55,(byte) 0x08,(byte) 0x68, (byte) 0x14, (byte) 0x93, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x13, (byte) 0x50, (byte) 0x00,

How to calculate crc16 in php

冷暖自知 提交于 2019-11-28 08:44:00
I need help in converting CRC code written in Ojective C to PHP. The following is the Objective C code static UInt16 CRC16_Table[] = { 0x0000, 0x2110, 0x4220, 0x6330, 0x8440, 0xa550, 0xc660, 0xe770, 0x0881, 0x2991, 0x4aa1, 0x6bb1, 0x8cc1, 0xadd1, 0xcee1, 0xeff1, 0x3112, 0x1002, 0x7332, 0x5222, 0xb552, 0x9442, 0xf772, 0xd662, 0x3993, 0x1883, 0x7bb3, 0x5aa3, 0xbdd3, 0x9cc3, 0xfff3, 0xdee3, 0x6224, 0x4334, 0x2004, 0x0114, 0xe664, 0xc774, 0xa444, 0x8554, 0x6aa5, 0x4bb5, 0x2885, 0x0995, 0xeee5, 0xcff5, 0xacc5, 0x8dd5, 0x5336, 0x7226, 0x1116, 0x3006, 0xd776, 0xf666, 0x9556, 0xb446, 0x5bb7, 0x7aa7,

How to configure calculation of CRC table

二次信任 提交于 2019-11-27 18:53:30
问题 There are a lot of CRC calculation examples out there. Simple implementations with bit shifting and more efficient with a pre-calculated table. But there are also a lot of Parameters of a CRC beside the polynomial that affect the calculation. You can evaluate these parameters here: http://zorc.breitbandkatze.de/crc.html These parameters are initial value of CRC reflection of input data reflection of output data final XOR value for CRC For some "standard" CRC algorithm these parameters are

Function to Calculate a CRC16 Checksum

家住魔仙堡 提交于 2019-11-27 17:26:37
I'm working on a library to provide simple reliable communication over an RS232 or RS485 connection. Part of this code involves using a CRC16 checksum on the data to detect corruption from line noise. I've created a function to calculate a CRC16 checksum, but it doesn't seem to be outputting correct values. The relevant code I've written is below (it can also be found here ). #include <stdint.h> #define CRC16 0x8005 uint16_t gen_crc16(const uint8_t *data, uint16_t size) { uint16_t out = 0; int bits_read = 0, bit_flag; /* Sanity check: */ if(data == NULL) return 0; while(size > 0) { bit_flag =

How to generate a CRC-16 from C#

落花浮王杯 提交于 2019-11-27 08:06:42
I am trying to generate a CRC-16 using C#. The hardware I am using for RS232 requires the input string to be HEX. The screenshot below shows the correct conversion, For a test, I need 8000 to be 0xC061, however the C# method that generates CRC-16 must be able to convert any given HEX string. I have tried using Nito.KitchenSink.CRC I have also tried the below which generates 8009 when 8000 is inputted - public string CalcCRC16(string strInput) { ushort crc = 0x0000; byte[] data = GetBytesFromHexString(strInput); for (int i = 0; i < data.Length; i++) { crc ^= (ushort)(data[i] << 8); for (int j =

crc16 implementation java

时间秒杀一切 提交于 2019-11-27 06:14:30
问题 I am having problems with calculating CRC-16 implementation of a byte array in java. Basically I am trying to send bytes to a RFID that starts writing to a tag. I can see the checksum value of array by looking tcpdump command on mac. But my goal is to generate it by myself. Here is my byte array which should generate 0xbe,0xd9: byte[] bytes = new byte[]{(byte) 0x55,(byte) 0x08,(byte) 0x68, (byte) 0x14, (byte) 0x93, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,

How to calculate crc16 in php

十年热恋 提交于 2019-11-27 02:24:04
问题 I need help in converting CRC code written in Ojective C to PHP. The following is the Objective C code static UInt16 CRC16_Table[] = { 0x0000, 0x2110, 0x4220, 0x6330, 0x8440, 0xa550, 0xc660, 0xe770, 0x0881, 0x2991, 0x4aa1, 0x6bb1, 0x8cc1, 0xadd1, 0xcee1, 0xeff1, 0x3112, 0x1002, 0x7332, 0x5222, 0xb552, 0x9442, 0xf772, 0xd662, 0x3993, 0x1883, 0x7bb3, 0x5aa3, 0xbdd3, 0x9cc3, 0xfff3, 0xdee3, 0x6224, 0x4334, 0x2004, 0x0114, 0xe664, 0xc774, 0xa444, 0x8554, 0x6aa5, 0x4bb5, 0x2885, 0x0995, 0xeee5,

How to generate a CRC-16 from C#

拜拜、爱过 提交于 2019-11-26 17:43:46
问题 I am trying to generate a CRC-16 using C#. The hardware I am using for RS232 requires the input string to be HEX. The screenshot below shows the correct conversion, For a test, I need 8000 to be 0xC061, however the C# method that generates CRC-16 must be able to convert any given HEX string. I have tried using Nito.KitchenSink.CRC I have also tried the below which generates 8009 when 8000 is inputted - public string CalcCRC16(string strInput) { ushort crc = 0x0000; byte[] data =