//+------------------------------------------------------------------+ //| Hash.mqh | //| Copyright 2026, Niquel Mendoza | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026, Niquel Mendoza" #property link "https://www.mql5.com" #property strict #ifndef MQLARTICLES_UTILS_BITS_HASH_MQH #define MQLARTICLES_UTILS_BITS_HASH_MQH //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #include "BitFastBuffer.mqh" #include #include //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ namespace TSN { //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ class CGenericHash_CBitBuffer { public: CGenericHash_CBitBuffer() {} ~CGenericHash_CBitBuffer() {} //--- static ulong Hash(const CBitBuffer &v) { return TSN::XUL::XXH64(v.m_bits, v.m_s + 1, 0ULL); } //--- static bool Eq(const CBitBuffer &a, const CBitBuffer &b) { if(a.m_s != b.m_s) return false; // igual dado que el array en si size real es ms + (w > 0) // ms reprensta la escritura actual for(int i = 0; i <= a.m_s; i++) if(a.m_bits[i] != b.m_bits[i]) return false; return true; } //--- template static void Assing(CHashMapFastInternalPar& a, CHashMapFastInternalPar& b) { a.hash = b.hash; a.value = b.value; a.key.RobarDe(b.key); } }; } //+------------------------------------------------------------------+ #endif // MQLARTICLES_UTILS_BITS_HASH_MQH