code: public static boolean isEqual(byte[] digesta, byte[] digestb) {
          if (digesta == digestb) return true;
          if (digesta == null || digestb == null) {
              return false;
          }
          if (digesta.length != digestb.length) {
              return false;
          }
  
          int result = 0;
          // time-constant comparison
          for (int i = 0; i < digesta.length; i++) {
              result |= digesta[i] ^ digestb[i];
          }
          return result == 0;
      }
docs: Compares two digests for equality. Does a simple byte compare.
  
  @param digesta one of the digests to compare.
  
  @param digestb the other digest to compare.
  
  @return true if the digests are equal, false otherwise.