public String generateResponseCode(long state, byte[] challenge)
      throws GeneralSecurityException {
    if (challenge == null) {
      return generateResponseCode(state);
    } else {
      // Allocate space for combination and store.
      byte[] value =
          ByteBuffer.allocate(8 + challenge.length)
              .putLong(state) // Write out OTP state
              .put(challenge, 0, challenge.length) // Concatenate with challenge.
              .array();
      return generateResponseCode(value);
    }
  }
@param state 8-byte integer value representing internal OTP state.
@param challenge Optional challenge as array of bytes.
@return A decimal response code
@throws GeneralSecurityException If a JCE exception occur
java/com/google/android/apps/authenticator/otp/PasscodeGenerator.java