mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-14 08:49:50 +00:00
dd301cd6a7
- Handle ^C in searches - Safer progerssbar for small terminals - Add 'ws' command to write pascal/dalvik/java strings - Fix visual refresh on terminal resize - Partially fix dex negative section issue
16 lines
310 B
C
16 lines
310 B
C
/* radare - LGPL - Copyright 2013 pancake */
|
|
|
|
#include <r_hash.h>
|
|
|
|
const int MOD_ADLER = 65521;
|
|
|
|
ut32 r_hash_adler32(const ut8 *data, int len) {
|
|
ut32 a = 1, b = 0;
|
|
int index;
|
|
for (index = 0; index < len; ++index) {
|
|
a = (a + data[index]) % MOD_ADLER;
|
|
b = (b + a) % MOD_ADLER;
|
|
}
|
|
return (b << 16) | a;
|
|
}
|