//+-------------------------------------------------------------------+ //| 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 TABLE_SIZE_FINAL (6ULL) #define TABLE_SIZE_BUCKETS (1ULL) //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ namespace TSN { const ulong g_table_test_seeds[TABLE_SIZE_BUCKETS] = { 25ULL }; const ulong g_table_test_hashes[TABLE_SIZE_FINAL] = { 7082449285793839247ULL, // UNO 8077034385145237811ULL, // TRES 1578112930777586163ULL, // CUATRO 889639972767027087ULL, // CINCO 0ULL, // invalid 16162063474616199333ULL }; const long g_table_test_values[TABLE_SIZE_FINAL] = { 1, // UNO 3, // TRES 4, // CUATRO 5, // CINCO -1, 2 // DOS }; long HashCustom(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 % TABLE_SIZE_BUCKETS); //--- ulong h = key_hash ^ g_table_test_seeds[seed_index]; h ^= h >> 16; h *= 0x45d9f3b37197344d; h ^= h >> 16; h *= 0x45d9f3b37197344d; h ^= h >> 16; const int fi = int(h % TABLE_SIZE_FINAL); return g_table_test_hashes[fi] == key_hash ? g_table_test_values[fi] : -1; } }