Cyclic redundancy check. An error checking mechanism used for verifying data integrity in serial protocols.
Questions tagged [crc]
1120 questions
5
votes
4 answers
Error Detection Effiency (CRC, Checksum, etc)
I have a hypothetical situation of sending data units, each of a thousand bytes. Failure rate is rare but when a error does occur it is less likely to be a single bit error and more likely to be an error in a few bits in a row.
At first I thought of…

irl_irl
- 3,785
- 9
- 49
- 60
5
votes
1 answer
Methods to nail down 16 bit CRC/Checksum algorithm used by Windows CE executable?
I need to reverse engineer CRC/Checksum algorithm implemented by windows CE executable. Being propritory protocol, it does not say anything about CRC/checksum algorithm. However, There is console interface that reports correct/calculated checksum…

Maulik Modi
- 183
- 3
- 18
5
votes
1 answer
compute CRC of struct in Python
I have the following struct, from the NRPE daemon code in C:
typedef struct packet_struct {
int16_t packet_version;
int16_t packet_type;
uint32_t crc32_value;
int16_t result_code;
char buffer[1024];
} packet;
I want to send this data…

verideskstar
- 183
- 2
- 8
5
votes
3 answers
CRC64 file checksum PHP implementation
I need to get CRC64 checksum of files using PHP.
With this code
file_put_contents('example.txt', 'just an example');
echo hash_file('crc32', 'example.txt');
I get CRC32 checksum "c8c429fe";
But I need to get a checksum using CRC64 algorithm (
)
I…

artask
- 429
- 7
- 18
5
votes
1 answer
ruby: `read': Invalid argument -(Errno::EINVAL) at File.read
I'm doing a simple script to check crc of all files...
require "zlib"
exit if Object.const_defined?(:Ocra)
files = Dir.glob("*")
File.open('dir.txt', 'a+') do |file|
file.puts files
end
File.read('dir.txt').each_line { |line|
file =…

ElektroStudios
- 19,105
- 33
- 200
- 417
4
votes
1 answer
How do I compute a standard ANSI CRC-16 hash in Javascript?
I need to compute an ANSI CRC-16 hash of plainText ASCII bytes using the standard ANSI CRC‐16 hash with the polynomial of X16 + X15 + X2 + 1.
For example, if I have plaintext of 1085051000201146587443HG234, I need to be able to generate the…

scottdevries
- 117
- 2
- 7
4
votes
1 answer
How the bit-reflect constant is calculated when we use CLMUL in CRC32?
Recently, I'm learning the CRC32 algorithm. There are various algorithms and what I'm most interested is the paper published by intel in 2009: Fast CRC Computation Using PCLMULQDQ Instruction. And I have checked the implementation in the kernel.
I…

Stillwaters
- 43
- 3
4
votes
1 answer
Fast CRC with PCLMULQDQ *NOT* reflected
I'm trying to write a PCLMULQDQ-optimized CRC-32 implementation. The specific CRC-32 variant is for one that I don't own, but am trying to support in library form. In crcany model form, it has the following parameters:
width=32 poly=0xaf…

Zac
- 876
- 1
- 8
- 18
4
votes
1 answer
How to check CRC16 validity
I'm working on receiving binary data from sensors for the first time.
The data is base64-encoded, I should decode the data and validate it and then save it to the database. One step of the validation process is to check for the CRC-16 validity.
Each…

Furqan S. Mahmoud
- 1,417
- 2
- 13
- 26
4
votes
1 answer
Python CRC calculation for the NTAG 424 NFC chip
I am currently working with the NXP NTAG 424 chips, which feature AES-128 encryption.
This chip requires the computation of a crc32 checkvalue whenever a new key is set (see the datasheet 11.6.1/Page 67). According to the data sheet, the crc is…

U_flow
- 475
- 5
- 18
4
votes
1 answer
Porting a CRC C algorithm to C#
I have this function in C that I need to port to C#. I've made a few attempts but can't figure out what I'm doing wrong.
The polynomial is 0x04C11DB7uL.
It doesn't have to include a while loop, i've also attempted with a For loop.
static uint32_t…

Ribeiro
- 364
- 1
- 3
- 12
4
votes
1 answer
Reverse engineer UPS serial protocol: Checksum/CRC?
I received an APC SMC1000 UPS device that I want to use to power a microcontroller-based application, and perform some tasks before shutting down. The UPS has both a serial and USB port, but the serial port protocol does not seem to be documented.…

KlaasDC
- 71
- 6
4
votes
3 answers
CRC Calculation
I'm trying to interface with a 3rd party system and they have provided a code sample to calculate a CRC value when sending text data.
The C code the vendor provided looks like this:
#define CRCRES 0xf0b8 /* residue for good verify */
#define…

Jeff
- 155
- 2
- 9
4
votes
4 answers
How fast is the code
I'm developing game. I store my game-objects in this map:
std::map mObjects;
std::string is a key/name of object to find further in code. It's very easy to point some objects, like: mObjects["Player"] = .... But I'm afraid…

Max Frai
- 61,946
- 78
- 197
- 306
4
votes
1 answer
Why does the CRC of "1" yield the generator polynomial itself?
While testing a CRC implementation, I noticed that the CRC of 0x01 usually (?) seems to be the polynomial itself. When trying to manually do the binary long division however, I keep ending up losing the leading "1" of the polynomial, e.g. with a…

David Schneider
- 472
- 5
- 13