diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-14 10:47:20 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-14 10:47:20 +0300 |
commit | f1985b03bdf77c049cc28b25fe6275867c25ba49 (patch) | |
tree | 54951693bad97b824e2a8f4f7fcfbd4727ca9d69 /src/blob.c | |
parent | 4562f44f9bac793b8397fdf35491da5d7ef815fa (diff) | |
download | apk-tools-f1985b03bdf77c049cc28b25fe6275867c25ba49.tar.gz apk-tools-f1985b03bdf77c049cc28b25fe6275867c25ba49.tar.bz2 apk-tools-f1985b03bdf77c049cc28b25fe6275867c25ba49.tar.xz apk-tools-f1985b03bdf77c049cc28b25fe6275867c25ba49.zip |
hash: allow caching of hash value
Diffstat (limited to 'src/blob.c')
-rw-r--r-- | src/blob.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -98,9 +98,9 @@ int apk_blob_split(apk_blob_t blob, apk_blob_t split, apk_blob_t *l, apk_blob_t } } -unsigned long apk_blob_hash(apk_blob_t blob) +unsigned long apk_blob_hash_seed(apk_blob_t blob, unsigned long seed) { - unsigned long hash = 5381; + unsigned long hash = seed; int i; for (i = 0; i < blob.len; i++) @@ -109,6 +109,11 @@ unsigned long apk_blob_hash(apk_blob_t blob) return hash; } +unsigned long apk_blob_hash(apk_blob_t blob) +{ + return apk_blob_hash_seed(blob, 5381); +} + int apk_blob_compare(apk_blob_t a, apk_blob_t b) { if (a.len == b.len) |