crc

tricky crc algorithm

徘徊边缘 提交于 2019-12-05 04:05:23
问题 I am trying to find the crc that works with the following results. The byte string consists of 2 bytes (ie. 0xCE1E) and the crc is an single byte (ie. 0x03) byte crc CE1E 03 CE20 45 CE22 6F 0000 C0 0001 D4 FFFF 95 Can anyone help? 回答1: First, 4 hex digits aren't 4 bytes. Since all your examples show 4 hex digits -- 2 bytes -- I'll assume you mean 2 bytes. There are only 65,536 distinct hash values, here's what you do. Execute the hash function for all 65,536 values from 0000 to FFFF. Tabulate

Shorter GUID using CRC

安稳与你 提交于 2019-12-05 02:14:57
问题 I am making a website in ASP.NET and want to be able to have a user profile which can be accessed via a URL with the users id at the end. Unique identifier is obviously a bad choice as it is long and (correct me if i am wrong) not really URL friendly. I was wondering if i produced a unique idnetifier on the ASP page then hashed it using CRC (or something similar) if it would still be as unique (or even unique at all) as just a GUID. For example: The GUID 6f1a7841-190b-4c7a-9f23-98709b6f8848

Matching CRC32 from STM32F0 and zlib

假如想象 提交于 2019-12-05 01:39:26
问题 I'm working on a communication link between a computer running Linux and a STM32F0. I want to use some kind of error detection for my packets and since the STM32F0 has CRC32 hw and I have zlib with CRC32 on Linux I thought it would be a good idea to use CRC32 for my project. The problem is that I won't get the same CRC value for the same data on the different platforms. #include <inttypes.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <zlib.h> int main(void) { uint8_t

Implementing CRC8 on Arduino to write to MLX90614

ε祈祈猫儿з 提交于 2019-12-04 22:55:11
UPDATE: I can't even get this calculator to reproduce the SMBus PECs illustrated in figures 8 and 9 of this datasheet ! So I'm interfacing an arduino with a Melexis temperature sensor, and it's going okay--aside from the fact that I can't seem to get the CRC check to work. I've gotten read operations to complete successfully (although my software ignores the packet error code) but I have tried a lot of implementations of CRC8 to check the PEC byte to no avail. The code block I am using now came from OneWire: uint8_t OneWire::crc8(const uint8_t *addr, uint8_t len) { uint8_t crc = 0; while (len-

Understanding two different ways of implementing CRC generation with LFSR

穿精又带淫゛_ 提交于 2019-12-04 17:12:20
There are two ways of implementing CRC generation with linear feedback shift registers (LFSR), as shown in this figure . The coefficients of generator polynomial in this picture are 100111, and the red "+" circles are exclusive-or operators. The initialization register values are 00000 for both. For example, if the input data bit stream is 10010011, both A and B will give CRC checksum of 1010. The difference is A finishes with 8 shifts, while B with 8+5=13 shifts because of the 5 zeros appended to the input data. I can understand B very easily since it closely mimics the modulo-2 division.

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

℡╲_俬逩灬. 提交于 2019-12-04 14:14:43
问题 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,

Find out CRC or CHECKSUM of RS232 data

*爱你&永不变心* 提交于 2019-12-04 12:50:23
I need to communicate with a RS232 device, I have no specs or information available. I send a 16 byte command and get a 16 byte result back. The last byte looks like some kind of crc or checksum, I have tried using this http://miscel.dk/MiscEl/miscelCRCandChecksum.html with no luck. Anyone can reverse engineer the crc/checksum algorithm? here is some data captured with an RS-232 monitor program: 01 80 42 00 00 00 00 00 00 00 00 00 00 00 01 B3 01 80 42 00 00 00 00 00 00 00 00 00 00 00 02 51 01 80 42 00 00 00 00 00 00 00 00 00 00 00 03 0F 01 80 42 00 00 00 00 00 00 00 00 00 00 00 04 8C 01 80 42

CRC checks for files

隐身守侯 提交于 2019-12-04 11:13:49
问题 I'm working with a small FAT16 filesystem, and I want to generate CRC values for indidual XML files which store configuration information. In case the data changes or is corrupted, I want to be able to check the CRC to determine that the file is still in it's original state. The question is, how do I put the CRC value into the file, without changing the CRC value of the file itself? I can think of a couple solutions, but I think there must be a fairly standard solution for this issue. 回答1:

Expected collisions for perfect 32bit crc

主宰稳场 提交于 2019-12-04 11:11:48
问题 I'm trying to determine how my crc compares to an " ideal " 32bit crc. So I ran my crc over 1 million completely random samples of data and collected the amount of collisions, I want to compare this number to the number of collisions I could expect from the " ideal " crc. Does anyone know how to calculate the expected collision for an " ideal " 32bit crc? 回答1: Compare your own CRC with 0x1EDC6F41 as your "ideal" reference. Having said that, there is no ideal 32-bit CRC. Different polynomials