crc16

Using only part of crc32

岁酱吖の 提交于 2019-12-08 10:32:31
问题 Will using only 2 upper/lower bytes of a crc32 sum make it weaker than crc16? Background: I'm currently implementing a wireless protocol. I have chunks of 64byte each, and according to Data Length vs CRC Length I would need at most crc16. Using crc16 instead of crc32 would free up bandwidth for use in Forward error correction (64byte is one block in FEC). However, my hardware is quite low powered but has hardware support for CRC32. So my idea was to use the hardware crc32 engine and just

CRC16 in Python

我的梦境 提交于 2019-12-07 14:01:22
问题 How do I calculate CRC16 in Python? In Perl I would write something like: use Digest::CRC "crc16"; $result = crc16($str); How do I do same thing in Python? 回答1: There is a library for calculating CRC16 here http://pypi.python.org/pypi/crc16/0.1.0 来源: https://stackoverflow.com/questions/5292290/crc16-in-python

CRC16 in Python

你离开我真会死。 提交于 2019-12-05 20:30:14
How do I calculate CRC16 in Python? In Perl I would write something like: use Digest::CRC "crc16"; $result = crc16($str); How do I do same thing in Python? There is a library for calculating CRC16 here http://pypi.python.org/pypi/crc16/0.1.0 来源: https://stackoverflow.com/questions/5292290/crc16-in-python

CRC-CCITT 16-bit Python Manual Calculation

若如初见. 提交于 2019-12-03 13:33:58
问题 Problem I am writing code for an embedded device. A lot of solutions out there for CRC-CCITT 16-bit calculations require libraries. Given that using libraries is almost impossible and a drain on its resources, a function is required. Possible Solution The following CRC calculation was found online. However, its implementation is incorrect. http://bytes.com/topic/python/insights/887357-python-check-crc-frame-crc-16-ccitt def checkCRC(message): #CRC-16-CITT poly, the CRC sheme used by ymodem

ISO/IEC13239 CRC16 Implementation

泪湿孤枕 提交于 2019-12-01 08:12:19
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) { current_crc_value = (char) ((current_crc_value >>> 1) ^

ISO/IEC13239 CRC16 Implementation

六月ゝ 毕业季﹏ 提交于 2019-12-01 05:01:31
问题 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++) {

CRC16 ISO 13239 Implementation

帅比萌擦擦* 提交于 2019-11-30 10:20:06
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 < data.Length; i++) { current_crc_value ^= data[i] & 0xFF; for (int j = 0; j < 8; j++) { if ((current_crc_value & 1) != 0) { current_crc_value = (current_crc_value >> 1) ^ POLYNOMIAL; } else { current_crc_value = current_crc_value >> 1; } } }

Calculating Modbus RTU CRC 16

不问归期 提交于 2019-11-30 07:10:49
问题 I'm implementing a software where I read and write data in Modbus RTU protocolo via serial. For that, I need to calculate the two CRC byte at the end of the string of bytes, but I'm being incapable of doing this. Searching throughout the web, I found two functions that seems to calculate the CRC correctly: WORD CRC16 (const BYTE *nData, WORD wLength) { static const WORD wCRCTable[] = { 0X0000, 0XC0C1, 0XC181, 0X0140, 0XC301, 0X03C0, 0X0280, 0XC241, 0XC601, 0X06C0, 0X0780, 0XC741, 0X0500,

CRC16 checksum: HCS08 vs. Kermit vs. XMODEM

空扰寡人 提交于 2019-11-30 07:09:57
I'm trying to add CRC16 error detection to a Motorola HCS08 microcontroller application. My checksums don't match, though. One online CRC calculator provides both the result I see in my PC program and the result I see on the micro. It calls the micro's result "XModem" and the PC's result "Kermit." What is the difference between the way those two ancient protocols specify the use of CRC16? you can implement 16 bit IBM, CCITT, XModem, Kermit, and CCITT 1D0F using the same basic code base. see http://www.acooke.org/cute/16bitCRCAl0.html which uses code from http://www.barrgroup.com/Embedded

CRC16 ISO 13239 Implementation

Deadly 提交于 2019-11-29 14:59:47
问题 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 < data.Length; i++) { current_crc_value ^= data[i] & 0xFF; for (int j = 0; j < 8; j++) { if ((current_crc_value & 1) != 0) { current_crc_value