From 0e69f144667e98193985d31f7ab372992f30e1de Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 12 Jul 2024 13:10:51 +0200 Subject: [PATCH] Update File Type - Bundle Database --- File Type - Bundle Database.-.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/File Type - Bundle Database.-.md b/File Type - Bundle Database.-.md index 3f82aff..8a0d2e4 100644 --- a/File Type - Bundle Database.-.md +++ b/File Type - Bundle Database.-.md @@ -73,4 +73,26 @@ typedef struct { } BundleContents; BundleContents contents[num_contents] ; +``` + +Algorithm to calculate resource hashes by WhiteGoat: +```cpp +uint64_t calc_hash(const std::vector& list) { + const uint64_t m = 0xc6a4a7935bd1e995ULL; + const int r = 47; + + uint64_t k = 0; + + for (auto&& name : list) { + uint64_t h = name; + + k *= m; + k ^= k >> r; + k *= m; + + h ^= k; + k = m * h; + } + return k; +} ``` \ No newline at end of file