* Create a compound hash. * @param hash The hash to add the string hash to. * @param s The string hash. * @return The new hash. */
| 115 | * @return The new hash. |
| 116 | */ |
| 117 | static uint32_t VersionHashStr(uint32_t hash, std::string_view s) |
| 118 | { |
| 119 | for (auto c : s) { |
| 120 | hash = std::rotl(hash, 3) ^ c; |
| 121 | hash = (hash & 1 ? hash >> 1 ^ 0xDEADBEEF : hash >> 1); |
| 122 | } |
| 123 | return hash; |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Make a hash of the file to get a unique "version number" |