Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1.         private int _cuckooHash(TKey key, int whichHashFunction)
  2.         {
  3.             if (whichHashFunction <= 0 || whichHashFunction > _universalHashingFamily.NumberOfFunctions)
  4.                 throw new ArgumentOutOfRangeException("Which Hash Function parameter must be betwwen 1 and " + NUMBER_OF_HASH_FUNCTIONS + ".");
  5.  
  6.             int hashCode = Math.Abs(_universalHashingFamily.UniversalHash(_equalityComparer.GetHashCode(key), whichHashFunction));
  7.  
  8.             return hashCode % _collection.Length;
  9.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement