diff --git a/Hashes.cpp b/Hashes.cpp index 7320be45..b810138a 100644 --- a/Hashes.cpp +++ b/Hashes.cpp @@ -1286,6 +1286,9 @@ const char * const nmhash32_ver("nmhash32, " NMHASH32_DESC_STR); const char * const nmhash32x_ver("nmhash32x, " NMHASH32_DESC_STR); constexpr unsigned sizeof_NMH_ACC_INIT = sizeof(NMH_ACC_INIT); constexpr unsigned countof_NMH_ACC_INIT = sizeof(NMH_ACC_INIT)/sizeof(*NMH_ACC_INIT); + +static const char rand_str[] = "rwgk8M1uxM6XX6c3teQX2yaw8FQWArmcWUSBJ8dcQQJWHYC9Wt2BmpvETxwhYcJTheTbjf49SVRaDJhbEZCq7ki1D6KxpKQSjgwqsiHGSgHLxvPG5kcRnBhjJ1YC8kuhbaJCWn9G6jm58Lr5wkVWNy38KcNjXVM3vExhQK516zntjrHTxSJYNQ1yvGucKZD8M34iBXT86B7y5xK3tu9pLGqgomKEbzvBJmod66BY3tDwRwttjfgB75xGAHMpLELXpArPJHWQxjHPQQgAcL9j4GDLyEmRSS2Fkv1sLwZoBMUmaD84cmKjocK4phgVEr13a65LsjKBw9Pg4VN4hkd149izWLjcA5"; + // objsize: 4202f0-420c7d: 2445 void nmhash32_test ( const void * key, int len, uint32_t seed, void * out ) { static bool once = false; @@ -1293,18 +1296,20 @@ void nmhash32_test ( const void * key, int len, uint32_t seed, void * out ) { NMH_ALIGN(NMH_ACC_ALIGN) uint32_t accX[sizeof(NMH_ACC_INIT)/sizeof(*NMH_ACC_INIT)]; NMH_ALIGN(NMH_ACC_ALIGN) uint32_t accY[sizeof(accX)/sizeof(*accX)]; printf("sizeof_NMH_ACC_INIT: %u\ncountof_NMH_ACC_INIT: %u\nsizeof(accX): %u\nsizeof(accY): %u\n", sizeof_NMH_ACC_INIT, countof_NMH_ACC_INIT, sizeof(accX), sizeof(accY)); - const uint32_t x = NMHASH32_long(NMH_ACC_INIT, sizeof(NMH_ACC_INIT), 42); - printf("NMHASH32_long(NMH_ACC_INIT, %u, 42) = %x\n", sizeof(NMH_ACC_INIT), x); + const unsigned count = 256; + static_assert(sizeof(rand_str) >= count); + const uint32_t x = NMHASH32_long(reinterpret_cast(rand_str), count, 42); + printf("NMHASH32_long(rand_str, %u, 42) = %x\n", count, x); once = true; } const uint32_t v = NMHASH32 (key, (const size_t) len, seed); - printf("NMHASH32(%p, %d, %u) = %u\n", key, len, seed, v); + // printf("NMHASH32(%p, %d, %u) = %u\n", key, len, seed, v); *(uint32_t*)out = v; } // objsize: 466100-4666d6: 1494 void nmhash32x_test ( const void * key, int len, uint32_t seed, void * out ) { const uint32_t v = NMHASH32X (key, (const size_t) len, seed); - printf("NMHASH32X(%p, %d, %u) = %u\n", key, len, seed, v); + // printf("NMHASH32X(%p, %d, %u) = %u\n", key, len, seed, v); *(uint32_t*)out = v; }