code: static boolean arraysEqual(byte[] array1, byte[] array2) {
      if (array1.length != array2.length) {
        return false;
      }
      
      boolean isEqual = true;
      for (int i = 0; i < array1.length; i++) {
        if (array1[i] != array2[i]) {
          isEqual = false;
        }
      }
      return isEqual;
    }
docs: Compares arrays for equality in constant time. This avoids
  certain types of timing attacks.
  
  @param array1 the first array
  @param array2 the second array
  @return whether the arrays match