//+-------------------------------------------------------------------+ //| Include generado por la herramienta PerfectHash SimPHash | //| Esta heramienta forma parte del ecositema TSN | //| Repositorio: https://forge.mql5.io/nique_372/SimPHash | //+-------------------------------------------------------------------+ #property copyright "Copyright 2026, Niquel Mendoza" #property link "https://www.mql5.com/" #property strict //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #include //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #define SIMPHASH_ENUMREG_TABLE_SIZE (8ULL) #define SIMPHASH_ENUMREG_TABLE_SIZE_LAST (7ULL) #define SIMPHASH_ENUMREG_BUCKET_SIZE (4ULL) #define SIMPHASH_ENUMREG_BUCKET_SIZE_LAST (3ULL) //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ namespace TSN { const ulong g_simphash_enum_reg_seeds[SIMPHASH_ENUMREG_BUCKET_SIZE] = { 1ULL, 0ULL, 1ULL, 0ULL }; const ulong g_simphash_enum_reg_hashes[SIMPHASH_ENUMREG_TABLE_SIZE] = { 13403357614718791261ULL, // HASH_UL1_SPLITMIX 6164940960123561931ULL, // HASH_UL1_FIBBO: 0ULL, // invalid 0ULL, // invalid 9986671065094935476ULL, // TSN_PHASH_TYPE_FNV1A_64 14868990445489101911ULL, // HASH_UL1_FMIX 1930730962192812994ULL, // HASH_UL1_MUR_MUR 17911910621320999858ULL }; long g_simphash_enum_reg_values[SIMPHASH_ENUMREG_TABLE_SIZE] = { 1, // HASH_UL1_SPLITMIX 3, // HASH_UL1_FIBBO: -1, -1, 0, // TSN_PHASH_TYPE_FNV1A_64 2, // HASH_UL1_FMIX 0, // HASH_UL1_MUR_MUR 1 // TSN_PHASH_TYPE_XXHASH_64 }; /* long TempHashCustom(const string& key) { //--- const int len = StringLen(key); ulong key_hash = 14695981039346656037ULL; FNV1a_64_AsM_Str(key, len, key_hash, 1099511628211ULL) const int seed_index = int(key_hash & SIMPHASH_ENUMREG_BUCKET_SIZE_LAST); //--- ulong h = key_hash + g_simphash_enum_reg_seeds[seed_index] * 0x9e3779b97f4a7c15; h = (h ^ (h >> 30)) * 0xbf58476d1ce4e5b9; h = (h ^ (h >> 27)) * 0x94d049bb133111eb; h ^= (h >> 31); const int fi = int(h & SIMPHASH_ENUMREG_TABLE_SIZE_LAST); return g_simphash_enum_reg_hashes[fi] == key_hash ? g_simphash_enum_reg_values[fi] : -1; } long TempHashCustom(const ulong key_hash) { const int seed_index = int(key_hash & SIMPHASH_ENUMREG_BUCKET_SIZE_LAST); //--- ulong h = key_hash + g_simphash_enum_reg_seeds[seed_index] * 0x9e3779b97f4a7c15; h = (h ^ (h >> 30)) * 0xbf58476d1ce4e5b9; h = (h ^ (h >> 27)) * 0x94d049bb133111eb; h ^= (h >> 31); const int fi = int(h & SIMPHASH_ENUMREG_TABLE_SIZE_LAST); return g_simphash_enum_reg_hashes[fi] == key_hash ? g_simphash_enum_reg_values[fi] : -1; } */ }