crc

Crc error with Expansion files

巧了我就是萌 提交于 2019-12-23 01:41:49
问题 Got success in uploading and download the Expansion files Apk external data, Android Expansion but now I am facing CRC while unzipping my files. Not getting exactly where the problem is, Google rename my files as .obb Searching for workaround, if any? Update Complete explanation defined here Steps to create APK expansion file 回答1: Fixed it, I just skip checking CRC32 algorithm and its working very fine. 回答2: I suspect you are having the same problem as this question. In brief, the sample code

Crc error with Expansion files

落爺英雄遲暮 提交于 2019-12-23 01:41:17
问题 Got success in uploading and download the Expansion files Apk external data, Android Expansion but now I am facing CRC while unzipping my files. Not getting exactly where the problem is, Google rename my files as .obb Searching for workaround, if any? Update Complete explanation defined here Steps to create APK expansion file 回答1: Fixed it, I just skip checking CRC32 algorithm and its working very fine. 回答2: I suspect you are having the same problem as this question. In brief, the sample code

checksum calculation

江枫思渺然 提交于 2019-12-23 01:25:36
问题 To calculate CRC I found a piece of code but I am not understanding the concept. Here is the code: count =128 and ptr=some value; calcrc(unsigned char *ptr, int count) { unsigned short crc; unsigned char i; crc = 0; while (--count >= 0) { crc = crc ^ (unsigned short)*ptr++ << 8; i = 8; do { if (crc & 0x8000) crc = crc << 1 ^ 0x1021; else crc = crc << 1; } while(--i); } return (crc); } Please any body explain and tell me the logic. 回答1: This looks like a CRC (specifically it looks like CRC-16

Improve speed on Crc16 calculation

你。 提交于 2019-12-22 15:55:12
问题 I need to calculate Crc16 checksums with a $1021 polynom over large files, below is my current implementation but it's rather slow on large files (eg a 90 MB file takes about 9 seconds). So my question is how to improve my current implementation (to make it faster), I have googled and looked at some samples implementing a table lookup but my problem is that I don't understand how to modify them to include the polynom (probably my math is failing). { based on http://miscel.dk/MiscEl

CRC32 Calculation for Zero Filled Buffer/File

家住魔仙堡 提交于 2019-12-22 15:11:14
问题 If I want to calculate the CRC32 value for a large number of consecutive zero bytes, is there a constant time formula I can use given the length of the run of zeros? For example, if I know I have 1000 bytes all filled with zeros, is there a way to avoid a loop with 1000 iterations (just an example, actual number of zeros is unbounded for the sake of this question)? 回答1: You can compute the result of applying n zeros not in O(1) time, but in O(log n ) time. This is done in zlib's crc32_combine

Remake of Fletcher checksum from 32bit to 8

拜拜、爱过 提交于 2019-12-22 12:36:41
问题 Is this conversion right from the original? uint8_t fletcher8( uint8_t *data, uint8_t len ) { uint8_t sum1 = 0xff, sum2 = 0xff; while (len) { unsigned tlen = len > 360 ? 360 : len; len -= tlen; do { sum1 += *data++; sum2 += sum1; tlen -= sizeof( uint8_t ); } while (tlen); sum1 = (sum1 & 0xff) + (sum1 >> 4); sum2 = (sum2 & 0xff) + (sum2 >> 4); } /* Second reduction step to reduce sums to 4 bits */ sum1 = (sum1 & 0xff) + (sum1 >> 4); sum2 = (sum2 & 0xff) + (sum2 >> 4); return sum2 << 4 | sum1;

CRC for cross platform applications

江枫思渺然 提交于 2019-12-22 10:45:29
问题 I wish to use common CRC logic in a VB.NET or C# application as well as on a C/Linux application. I have one C/Linux application that interacts with a webservice (written in C#) and also a web application (written in VB.NET). For some data, I want to add a CRC to the data itself (say a file) from the .NET side and check for the integrity of the data (checking the CRC) on the client - and also vice-versa. Can somebody please guide me? 回答1: Since CRC implementation is a one-liner, I don't think

Save a CRC value in a file, without altering the actual CRC Checksum?

痞子三分冷 提交于 2019-12-22 06:37:51
问题 I am saving some Objects I have defined from my own classes, to File. (saving the stream data). That is all fine, but I would like to be able to store in the File the CRC checksum of that File. Then, whenever my Application attemps to Open a File, it can read the internally stored CRC value. Then perform a check on the actual File, if the CRC of the File matches the internally stored CRC value I can process the File normally, otherwise display an error message to say the File is not valid. I

What is the hamming distance, and how do I determine it for a CRC scheme?

北城以北 提交于 2019-12-22 05:04:06
问题 While studying for a class in computer networks, the prof talked about the hamming distance between 2 valid code words in a sample code. I have read about hamming distance, and it makes sense from the perspective of telling the difference distance between 2 strings. For example: Code Word 1 = 10110 The sender sends code word 1, and there is an error introduced, and the receiver receives 10100. So you see that the 4th bit was corrupted. This would result in the a hamming distance of 1 because:

Why use xor with a literal instead of inversion (bitwise not)

瘦欲@ 提交于 2019-12-22 03:24:09
问题 I have come across this CRC32 code and was curious why the author would choose to use crc = crc ^ ~0U; instead of crc = ~crc; As far as I can tell, they are equivalent. I have even disassembled the two versions in Visual Studio 2010. Not optimized build: crc = crc ^ ~0U; 009D13F4 mov eax,dword ptr [crc] 009D13F7 xor eax,0FFFFFFFFh 009D13FA mov dword ptr [crc],eax crc = ~crc; 011C13F4 mov eax,dword ptr [crc] 011C13F7 not eax 011C13F9 mov dword ptr [crc],eax I also cannot justify the code by