Questions tagged [crc16]

CRC16 is a 16-bit Cyclic Redundancy Check code, used mainly as an error detection method during data transmission.

A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data. Blocks of data entering these systems get a short check value attached, based on the remainder of a polynomial division of their contents; on retrieval the calculation is repeated, and corrective action can be taken against presumed data corruption if the check values do not match. Because the check value has a fixed length, the function that generates it is occasionally used as a hash function.wikipedia

The most commonly used polynomial lengths are:

  • CRC-8: 9 bits
  • CRC-16: 17 bits
  • CRC-32: 33 bits
  • CRC-64: 65 bits

A truly excellent tutorial on CRC's is Ross Williams' "Painless Guide to CRC Detection Algorithms", which can also be found here, here, here, here, and here.

323 questions
2
votes
3 answers

CRC 16 -DECT with poly x^16 + x^10 + x^8 + x^7 + x^3 + 1

believe me I have tried to code this, tried Google, and haven't had any luck. I'm trying to implement a CRC16 using this poly x^16 + x^10 + x^8 + x^7 + x^3 + 1 using the C language. Since I understand PHP better I'm trying to get a function going,…
Nick
  • 59
  • 2
  • 9
2
votes
2 answers

How to calculate the CRC in RFID protocol

When reading data from a RFID device you will find a CRC-CCITT over the payload. "The CRC is initialized with 0x3791 instead of the usual value 0xFFFF." How can I define the function, that checks that the CRC is ok. sample data: { 0x02, 0x40, 0x00,…
harper
  • 13,345
  • 8
  • 56
  • 105
2
votes
0 answers

Why my checksum(crc16) in uart is not matched?

I created xmodem used in UART. This protocol have checksum of data payload in uint16_t. I tested this part of code showing below, but it is still stucked. Showing below in the picture. Received chuck and another checksum calculated from the data…
NEWBIEEBIEE
  • 197
  • 2
  • 13
2
votes
2 answers

16bit CRC-ITU calculation for Concox tracker

I am creating C# code for a server program that receives data from a Concox TR06 GPS tracker via TCP: http://www.iconcox.com/uploads/soft/140920/1-140920023130.pdf When first starting up, the tracker sends a login message, which needs to be…
Fabricio Rodriguez
  • 3,769
  • 11
  • 48
  • 101
2
votes
1 answer

CRC16 with VHDL (multiple input bytes)

The below VHDL snippet correctly gets me the 16-bit CRC for a single input byte. How would I extend that for multiple input bytes, e.g. a frame that now spans 128 bytes to be crc'd? NB: function 'crc16' was generated using some online tool, but I…
user2286339
  • 184
  • 1
  • 4
  • 18
2
votes
1 answer

OWI_ComputeCRC16 returning value 0

I am checking out this function OWI_ComputeCRC16() and when I test the function with OWI_ComputeCRC16(0 >> 8, 0), the return value is 0. /** * @brief Compute the CRC16 value of a data set. * @details This function will compute the CRC16 of…
urosm
  • 23
  • 3
2
votes
1 answer

Is it true that lower 16 bits of CRC32 is CRC16?

I just found that this page is saying... I believe that CRC16 can be obtained from CRC32 by dropping the upper 16 bits. Is it true? Then is the lower 8 bits is for CRC8?
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184
2
votes
2 answers

How to avoid crc16 collisions?

I am experiencing a pretty annoying issue, using a crc16 hash to manage some of my informations. In my application, I pass some information into an url parameter, a huge encoded context. That context allow the users to recover their old searches. In…
Loot
  • 71
  • 8
2
votes
4 answers

Difference in Boost CRC and linux/lib/crc-ccitt.c

I have two sources to calculate the seemingly same crc value. I can not figure out why the 'boost/crc.hpp' implementation differs from the 'linux/lib/crc-ccitt.c' implementation. crc-ccitt.c boost Here is an example that illustrates the Problem. It…
Johannes
  • 6,490
  • 10
  • 59
  • 108
2
votes
2 answers

Python CRC for cashcode driver (From JS to Python)

I try to re-write CCNET driver for CashCode, from node to Python. But, i realy can`t run CRC generator. You can find "working" code on Github repo Here is the JS function: function getCRC16(bufData) { var POLYNOMIAL = 0x08408; var sizeData =…
ubombi
  • 1,115
  • 2
  • 15
  • 30
2
votes
1 answer

I got 0x1E error (INTEGRITY_ERROR) while change DESFire master key.What are my mistakes?And How can I resolve?

Whole update1: see question again. I recently am working with DESFire cards .I now decide to change defult master key of PICC. (I already could authenticate with master key all 8 byte 0x00 successfully) 1- Defult master key is 8 byte of zero.It is…
setare ab
  • 183
  • 1
  • 12
2
votes
2 answers

Reverse engineering to get CRC16 Polynomial

I'm trying to find an efficient way to calculate the CRC16 polynomial using the base value and the CRC16 output. An example to be more clear: y = CRC16(x) How can I find the polynomial used by CRC16 function to evaluate y? I'm using C and Python to…
neoben
  • 743
  • 12
  • 30
2
votes
1 answer

how to calculate ANSI CRC16 polynomial (0x8005) in python3?

I tried to calculate ANSI CRC16 polynomial (0x8005) using this code import crcmod crc16 = crcmod.mkCrcFun(0x8005, 0xffff, True) but I got this error message ValueError: The degree of the polynomial must be 8, 16, 24, 32 or 64
Gray
  • 267
  • 1
  • 6
  • 12
2
votes
1 answer

Custom CRC16 with bit reflection

To expand and give explanation that may also go with the link posted above, here is a function in PHP for getting a CRC16 checksum for string data: function crc16($data) { $crc = 0xAC6F; $len = strlen($data); $i = 0; …
user3282492
  • 29
  • 1
  • 5
2
votes
1 answer

Inheriting and modifying __init__() method

My lab is receiving some new equipment soon, and I'm writing my own modbus script to automate test processes. Thus far, this is the most complex task I've had to pit my limited programming proficiency against. Instead of writing a new class from…
PolskiPhysics
  • 255
  • 2
  • 8