crc

Fast CRC algorithm?

落花浮王杯 提交于 2019-12-03 04:34:37
问题 I want to create a 32 bit number out of an ASCII-string. CRC32 algorithm is exactly what I'm looking for but I can't use it because the table it requires is way too huge (it is for an embedded systems where ressources are VERY rare). So: any suggestions for a fast and slim CRC algorithm? It does not matter when collissions are a bit more probable than with the original CRC32. Thanks! 回答1: CRC implementations use tables for speed. They are not required. Here is a short CRC32 using either the

Calculating FCS(CRC) for HDLC frame

[亡魂溺海] 提交于 2019-12-03 03:55:08
I have the following frame: 7e 01 00 00 01 00 18 ef 00 00 00 b5 20 c1 05 10 02 71 2e 1a c2 05 10 01 71 00 6e 87 02 00 01 42 71 2e 1a 01 96 27 be 27 54 17 3d b9 93 ac 7e If I understand correctly, then it is this portion of the frame on which the FCS is calculated: 010000010018ef000000b520c1051002712e1ac205100171006e8702000142712e1a019627be2754173db9 I've tried entering this into a number of online calculators but I cant produce 0x93ac from the above data. http://www.lammertbies.nl/comm/info/crc-calculation.html with input type hex. How is 0x93ac arrived at? Thanks, Barry Ilya First of all, CRC

how to calculate CRC value for a file in C#.net?

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i want to calculate the CRC value for a file using 32-bit algorithm in C#.net.... 回答1: Algorithm is straightforward (rewritten from c++) class Crc32 { public static uint CountCrc(byte[] pBuf) { // Table of CRC-32's of all single byte values uint[] crctab = new uint[] { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551,

How to calculate CRC-16 from HEX values?

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my code i need to calculate CRC-16 16 bit values for the HEX values stored as NSdata, below is the code snippet to calculate CRC-16 in 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

ISO/IEC13239 CRC16 Implementation

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need a CRC16 implementation for NFC Tags. As the standard tolds me this is ISO/IEC13239 and a sample C code is provided. I translated this code into Java but it gives me wrong results: private static final char POLYNOMIAL = 0x8404; private static final char PRESET_VALUE = 0xFFFF; public static int crc16(byte[] data) { char current_crc_value = PRESET_VALUE; for (int i = 0; i < data.length; i++) { current_crc_value = (char) (current_crc_value ^ ((char) data[i])); for (int j = 0; j < 8; j++) { if ((current_crc_value & 0x0001) == 0x0001) {

CRC-4 implementation in C#

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been searching the net for a C# implementation of the 4-bit cyclic redundancy check (CRC-4-ITU) but so far I've been unsuccessful. Is there anyone who's able to give me a reference implementation of CRC-4-ITU? Preferrably with the standard polynomial if there is a standard polynomial (I've read the spec pointed to by wikipedia as the CRC4 spec without finding a definition of the polynomial). I'd also really appreciate some sort of test suite or test data to verify a CRC4 implementation. Thanks! 回答1: The Cyclic Redundancy Check article

How to calculate crc16 in php

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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,

CRC16 ISO 13239 Implementation

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i'm trying to implement Crc16 in C#. I already tried many different implementations, but most of them gives me different values. Here are some of the codes that i already used. private static int POLYNOMIAL = 0x8408; private static int PRESET_VALUE = 0xFFFF; public static int crc16(byte[] data) { int current_crc_value = PRESET_VALUE; for (int i = 0; i > 1) ^ POLYNOMIAL; } else { current_crc_value = current_crc_value >> 1; } } } current_crc_value = ~current_crc_value; return current_crc_value & 0xFFFF; } this is the another implementation

CRC32校验算法-C实现

匿名 (未验证) 提交于 2019-12-03 00:05:01
CRC即循环冗余校验码 CRC即循环冗余校验码(Cyclic Redundancy Check):是数据通信领域中最常用的一种差错校验码,其特征是信息字段和校验字段的长度可以任意选定。 CRC校验实用程序库在数据存储和数据通讯领域,为了保证数据的正确,就不得不采用检错的手段。 以下是CRC32的C语言实现,经过测试,能够正确运行: https://blog.csdn.net/weed_hz/article/details/25132343 来源:51CTO 作者: 仅仅是一只码农 链接:https://blog.csdn.net/qq_23940143/article/details/100850069