Questions tagged [adler32]

Adler-32 is a fast checksum algorithm used in zlib to verify the results of decompression. It is composed of two sums modulo 65521. Start with s1 = 1 and s2 = 0, then for each byte x, s1 = s1 + x, s2 = s2 + s1. The two sums are combined into a 32-bit value with s1 in the low 16 bits and s2 in the high 16 bits.

39 questions
23
votes
5 answers

How reliable is the adler32 checksum?

I wonder how reliable the adler32 checksum is, compared to e.g. md5 checksums? It was told on wikipedia that adler32 is "much less reliable" than md5, so I wonder how much, and in which way? More specifically, I'm wondering if it is reliable enough…
Samuel Lampa
  • 4,336
  • 5
  • 42
  • 63
17
votes
6 answers

Why modulo 65521 in Adler-32 checksum algorithm?

The Adler-32 checksum algorithm does sums modulo 65521. I know that 65521 is the largest prime number that fits in 16 bits, but why is it important to use a prime number in this algorithm? (I'm sure the answer will seem obvious once someone tells…
Kristopher Johnson
  • 81,409
  • 55
  • 245
  • 302
11
votes
3 answers

How do I make a checksum from a JavaScript Object?

I need to make a checksum from a JavaScript Object. Unfortunately, there does not seem to be an easy way to accomplish this because of JavaScript's Object ordering. For example, take these Objects: var obj1 = {type:"cake",quantity:0} , obj2 =…
striking
  • 655
  • 1
  • 8
  • 25
11
votes
1 answer

Horrific collisions of adler32 hash

When using adler32() as a hash function, one should expect rare collisions. We can do the exact math of collisions probability, but roughly speaking, since it is a 32-bits hash function, there should not be many collisions on a sample set of a few…
Paul Oyster
  • 1,133
  • 1
  • 12
  • 21
5
votes
1 answer

How to solve a Zlib adler32 rolling checksum problem?

I am using adler32 function from zlib to calculate the weak checksum of a chunk of memory x (4096 in length). Everything is fine, but now I would like to perform the rolling checksum if the chunks from different file do not match. However, I am not…
boost
  • 101
  • 2
  • 4
4
votes
2 answers

Security Error. Illegal access detected using ccavenue in php

I am successfully redirecting to ccavenue payment gateway but on clicking the cancel button it is showing the error "Security Error. Illegal access detected" in the redirect url page. This is my redirecturl page:
Peace
  • 616
  • 2
  • 8
  • 24
4
votes
1 answer

Does Adler32 of message + adler sum to zero (like CRC32)

CRC-32 has this wonderful property that appending a CRC to the end of message allows you to perform verification of the message by calculating a CRC of the entire thing, and if the checksum passes, the final result will be zero. Is this property…
Brian McFarland
  • 9,052
  • 6
  • 38
  • 56
4
votes
2 answers

Adler32 Repeating Very Quickly

I'm using the adler32 checksum algorithm to generate a number from a database id. So, when I insert a row into the database, I take the identity of that row and use it to create the checksum. The problem that I'm running into is that I just…
threejeez
  • 2,314
  • 6
  • 30
  • 51
3
votes
1 answer

Hash function combining - is there a significant decrease in collision risk?

Does anyone know if there's a real benefit regarding decreasing collision probability by combining hash functions? I especially need to know this regarding 32 bit hashing, namely combining Adler32 and CRC32. Basically, will adler32(crc32(data))…
Webmaster
  • 43
  • 5
2
votes
1 answer

Is this a bug in Java's Inflater or what?

I was bitten by this in some unit tests. I want to decompress some ZLIB-compressed data, using Inflater, where the raw data length is known in advance. This (straightforward) works as expected /* * Decompresses a zlib compressed buffer,…
leonbloy
  • 73,180
  • 20
  • 142
  • 190
2
votes
2 answers

Can a CRC32 engine be used for computing CRC16 hashes?

I'm working with a microcontroller with native HW functions to calculate CRC32 hashes from chunks of memory, where the polynomial can be freely defined. It turns out that the system has different data-links with different bit-lengths for CRC, like…
gabriel_agm
  • 513
  • 1
  • 4
  • 14
2
votes
2 answers

Why does my rolling adler32 checksum not work in go? (modulo arithmetic)

I am implementing, in go, a rolling version of the adler32 checksum. This answer was helpful to double check my maths. However I am struggling at implementing it correctly in golang. I wrote the following code: func roll(adler, n, leave, enter…
user48678
  • 2,382
  • 3
  • 24
  • 30
2
votes
3 answers

Php: How to calculate Adler32 checksum for zip?

I'm using a combination of Paul Duncans php ZipStream (http://pablotron.org/software/zipstream-php/) on the server side, for on-the-fly creation of zips, and Fzip (http://codeazur.com.br/lab/fzip/) on the Flex/Air client side. Works fine in Air, but…
Cambiata
  • 3,705
  • 9
  • 35
  • 45
1
vote
5 answers

Differences in calculation of adler32 rolling checksum - python

Need a clarification while looking at calculating a running checksum. Assume I have data like this. data = 'helloworld' Assuming a blocksize of 5, I need to calculate running checksum. >>> zlib.adler32('hello') 103547413 >>>…
Liju Mathew
  • 871
  • 1
  • 18
  • 31
1
vote
2 answers

Given a filename, how can I get the Adler32 using Crypto++

Given a "string filename", how can I get the Adler32 checksum using the C++ Crypto++ library. I am a little confused about using their Source and Sink system. Below I have the skeleton of the code that does MD5, but I can't seem to find any examples…
The Unknown
  • 19,224
  • 29
  • 77
  • 93
1
2 3