Class HashFunctionTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.common.hash.HashFunctionTestCase

public abstract class HashFunctionTestCase extends OpenSearchTestCase
Base class for testing the quality of hash functions.
  • Constructor Details

    • HashFunctionTestCase

      public HashFunctionTestCase()
  • Method Details

    • hash

      public abstract byte[] hash(byte[] input)
    • outputBits

      public abstract int outputBits()
    • testAvalanche

      public void testAvalanche()
      Tests if the hash function shows an avalanche effect, i.e, flipping a single input bit should flip half the output bits.