summaryrefslogtreecommitdiff
path: root/src/apk_database.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/apk_database.h')
-rw-r--r--src/apk_database.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/apk_database.h b/src/apk_database.h
index e65a1de..587aefb 100644
--- a/src/apk_database.h
+++ b/src/apk_database.h
@@ -237,4 +237,12 @@ void apk_name_foreach_matching(struct apk_database *db, struct apk_string_array
void (*cb)(struct apk_database *db, const char *match, struct apk_name *name, void *ctx),
void *ctx);
+static inline uint8_t apk_dbf_digest(struct apk_db_file *dbf)
+{
+ uint8_t alg = apk_digest_alg_by_len(dbf->csum.type);
+ if (alg == APK_DIGEST_SHA1 && dbf->diri->pkg->ipkg->sha256_160)
+ alg = APK_DIGEST_SHA256_160;
+ return alg;
+}
+
#endif