code: public static int hash(final long value, final int mask)
      {
          long hash = value * 31;
          hash = (int)hash ^ (int)(hash >>> 32);
  
          return (int)hash & mask;
      }
docs: Generate a hash for a long value.
  
  @param value to be hashed.
  @param mask  mask to be applied that must be a power of 2 - 1.
  @return the hash of the value.