Class ByteComparator

java.lang.Object
com.codingchili.core.security.ByteComparator

public abstract class ByteComparator extends Object
Compares byte arrays in constant-time.
  • Constructor Details

    • ByteComparator

      public ByteComparator()
  • Method Details

    • compare

      public static boolean compare(String first, String second)
      Compares two strings in constant time.
      Parameters:
      first - the first string.
      second - the second string.
      Returns:
      true if both Strings are of equal size and content.
    • compare

      public static boolean compare(byte[] first, byte[] second)
      Compares two byte arrays in constant time.
      Parameters:
      first - the first array.
      second - the second array.
      Returns:
      true if both arrays are of equal size and content.