This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user