Code example for HashCode

Methods: asInt

0
   * @param id The byte array that may have been previously seen. 
   * @return Whether the byte array is contained in the ByteArrayFilter. 
   */ 
  public boolean containsAndAdd(byte[] id) {
    HashCode code = HASH_FUNC.hashBytes(id);
    int index = Math.abs(code.asInt()) & sizeMask;
    byte[] oldId = array.getAndSet(index, id);
    return Arrays.equals(id, oldId);
  } 
 
  /** 
   * Returns the size of the underlying array. Welp. 
   * 
   * @return The size of the underlying array. 
   */ 
  public int getSize() { 
    return array.length();
  } 
} 
Experience pair programming with AI  Get Codota for Java