Update hasher data to context
Release / release (push) Successful in 4s

This commit is contained in:
Abdelrahman Said
2026-09-22 21:47:46 +01:00
parent 17be4841e6
commit 9881c0ac9a
6 changed files with 62 additions and 62 deletions
+6 -6
View File
@@ -6,16 +6,16 @@
#include "../../../common/assert/assert.h"
#include "../../../common/misc/misc_utils.h"
wp_intern inline void validateMur3HasherData(const WpMur3HasherData *io);
wp_intern inline void validateMur3HasherCtx(const WpMur3HasherCtx *io);
wp_intern inline u64 fmix64(u64 k);
WpHasher wpX64Mur3Hasher(WpMur3HasherData *data) {
WpHasher wpX64Mur3Hasher(WpMur3HasherCtx *data) {
return (WpHasher){ .func = wpX64Mur3Hasher128, .data = (void *)data };
}
WpU128Hash wpX64Mur3Hasher128(WpU8Stream *bytes, void *hasher_io) {
WpMur3HasherData *io = (WpMur3HasherData *)hasher_io;
validateMur3HasherData(io);
WpMur3HasherCtx *io = (WpMur3HasherCtx *)hasher_io;
validateMur3HasherCtx(io);
const i32 nblocks = (bytes->count * bytes->item_size) / 16;
@@ -99,8 +99,8 @@ WpU128Hash wpX64Mur3Hasher128(WpU8Stream *bytes, void *hasher_io) {
return (WpU128Hash){ .hash = { [0] = h1, [1] = h2 } };
}
wp_intern inline void validateMur3HasherData(const WpMur3HasherData *data) {
wpRuntimeAssert(data->magic == WP_MUR3_HASHER_MAGIC, "Invalid Murmur3 hash data");
wp_intern inline void validateMur3HasherCtx(const WpMur3HasherCtx *ctx) {
wpRuntimeAssert(ctx->magic == WP_MUR3_HASHER_MAGIC, "Invalid Murmur3 hash context");
}
wp_intern inline u64 fmix64(u64 k) {