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
0
votes
2 answers

C# CRC-16-CCITT 0x8408 Polynomial. Help needed

I am new in communications programming. Basically, I need to get the hex equivalent of the CRC output. I have a hex string which is the parameter - EE0000000015202020202020202020202020323134373030353935 This is concatenation of two strings. The…
drchanix
  • 31
  • 1
  • 3
0
votes
1 answer

Why using Generator polynomial like this x^8 +x^2 +x+1 for CRC-8?

Why using Generator polynomial like this G(x) =x^8 +x^2 +x+1 for CRC-8. If this is optimal How can we prove it. or using this Polynomial G(x) = x^5 + x^4 + x^2 + 1 for CRC-5-ITU.
hussein_moh
  • 27
  • 2
  • 11
0
votes
1 answer

How to detect errors in CRC-protected data?

As far as I understand to check if the data with it's CRC appended to the end of it has errors, one needs to run it through the same CRC algorithm and see if the newly calculated CRC is zero. I've tried going though this using an online CRC…
andrey
  • 1,515
  • 5
  • 23
  • 39
0
votes
2 answers

Reverse engineering unknown CRC

I'm trying to reverse engineer a CRC. When I calculate the CRC-16 for the data, it is very similar to the crc send with the data, but not exactly equal. What is the best way to find out the exact way to calculate this CRC? Can it be that another…
Douwe66
  • 51
  • 5
0
votes
2 answers

Need help reverse engineering a CRC16

I'm trying to connect to the Safecom TA-810 (badge/registration system) to automate the process of calculating how long employee's have worked each day. Currently this is done by: Pulling the data into the official application Printing a list of…
MythJuha
  • 11
  • 4
0
votes
1 answer

CRC16 code from Java to PHP

How to convert the Java CRC16 code to PHP code? PHP doesn't accept byte and >>> public static int CRC16(final byte[] buffer) { int crc = 0xffff; for (int i = 0; i < buffer.length; i++) { crc = ((crc >>> 8) | (crc << 8))…
elenson
  • 13
  • 3
0
votes
2 answers

example for VB.NET to calculate CRC16 of an string or Byte Array

With reference to this link Calculate CRC32 of an String or Byte Array I modified the code in order to calculate the CRC16 instead of CRC32, however I am getting wrong result, can some one point me where is the mistake? Private Sub…
H. Saffour
  • 57
  • 1
  • 1
  • 8
0
votes
1 answer

Convert C# unit test to a method

I have been given some code written as a unit test for xunit. I need to use this code in my application to generate a CRC-16. How can I get the code below to return what I need? [Fact] public void ComputesCrc16FromTelegramOf8000() { …
dynamicuser
  • 1,522
  • 3
  • 24
  • 52
0
votes
1 answer

What implementation of CRC-16 is used by sun.misc.CRC16?

The work I'm doing requires us to store CRC16 checksums along with rows of data, and recently I've discovered that the performance of sun.misc.CRC16 is one of the primary bottlenecks in the code that we're running. I've found out from searching that…
Kyune
  • 3
  • 2
0
votes
1 answer

CRC 16-CCITT with lookup table

So what I know about CRC, and also did a Java implementation is this: Having an initial message as a 16-bit polynomial, for instance 0x0617 65 0000.0110.0001.0111 this one gets another 16 of 0 bits 0000.0110.0001.0111|0000.0000.0000.0000 Then,…
George Irimiciuc
  • 4,573
  • 8
  • 44
  • 88
0
votes
1 answer

Voice pick code

I am relatively new to VBA coding in excel. I am trying to develop a backup system for labeling that is PTI compliant. I am wanting to establish a Voice pick code within an excel file. I understand that the VPC calculator is a free download, but I…
0
votes
1 answer

include two CRC16 bytes in a program ...?

i want to send some bytes via RS232 to a DSPIC33F that controls a robot motors, the DSPIC must receive 9 bytes orderly the last 2 bytes are for CRC16, am working in C#, so how can i calculate the CRC bytes meant to be sent. the program that…
Bouzenzel
  • 187
  • 1
  • 1
  • 18
0
votes
1 answer

CRC 16 for DECT in C#

There's a similar question asked and answered in C, but I'm struggling a bit to achieve the same thing in C#. Generator Polynomial : x^16 + x^10 + x^8 + x^7 + x^3 + 1 which is equivalent to 10000010110001001 in binary. I have 48 bits of data, and…
SanVEE
  • 2,009
  • 5
  • 34
  • 55
0
votes
2 answers

CRC16 collision (2 CRC values of blocks of different size)

The Problem I have a textfile which contains one string per line (linebreak \r\n). This file is secured using CRC16 in two different ways. CRC16 of blocks of 4096 bytes CRC16 of blocks of 32768 bytes Now I have to modify any of these 4096 byte…
grubi
  • 155
  • 2
  • 16
0
votes
1 answer

Convert CRC16 from C to Ruby using truncated polynomial 800516

I am very new to Ruby, please help. This is a C code which I need to convert into Ruby. Passing values [1,2,3,4,5] it gives me B059 in HEX unsigned short CalcCrc16(const unsigned char *Data,unsigned short DataLen) { unsigned short…
Deepak Kumar Jha
  • 462
  • 6
  • 15