<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 組件源碼 ``` /** * <b>方法描述:</b> MD5計算簽名 <br/> * <b>創建者:</b> admin <br/> * <b>創建時間:</b> 2018-05-08 18:12:07 <br/> * * @param contants * 入參|待編碼數據(byte數組或字符串)|{@link Object} * @param isfile * 入參|是否是對文件編碼|{@link boolean} * @param codeset * 入參|字符串編碼(UTF-8或GBK)|{@link java.lang.String} * @param md5txt * 出參|MD5簽名內容|{@link java.lang.String} * @return -1 異常<br/> * 0 失敗<br/> * 1 成功<br/> */ @Component(label = "MD5計算簽名", style = "判斷型", type = "同步組件", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-08 06:12:07") @InParams(param = { @Param(name = "contants", comment = "待編碼數據(byte數組或文件名)", type = Object.class), @Param(name = "isfile", comment = "是否是文件", type = boolean.class), @Param(name = "codeset", comment = "字符串編碼(UTF-8或GBK)", type = java.lang.String.class) }) @OutParams(param = { @Param(name = "md5txt", comment = "MD5簽名內容", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "-1", desp = "異常"), @Return(id = "0", desp = "失敗"), @Return(id = "1", desp = "成功") }) public static ResultBase P_md5Enc(Object contants, boolean isfile, String codeset) { if (contants == null) { return ResultBase.newFailureResult("TPTS0005", "待編碼內容不能為空"); } String strErr = ""; try { MessageDigest md5 = MessageDigest.getInstance("MD5"); byte by[] = null; if (isfile) { String fileName = contants.toString(); File file = new File(fileName); FileInputStream fis = new FileInputStream(file); byte[] buffer = new byte[(int) file.length()]; fis.read(buffer); fis.close(); by = md5.digest(buffer); } else { if (contants instanceof String) { by = md5.digest(((String) contants).getBytes(codeset)); } else if (contants instanceof byte[]) { by = md5.digest((byte[]) contants); } } if (by != null) { String strRet = ""; for (int i = 0; i < by.length; i++) strRet += Integer.toString(0x200 + by[i], 16).substring(1); return ResultBase.newSuccessResult(strRet); } else { strErr = "不支持對輸入對象進行MD5編碼"; } } catch (Exception ex) { AppLog.error(ex); strErr = AppLog.errorMsg(ex); } return ResultBase.newExceptionResult("TPTS0006", "MD5計算簽名出現異常:" + strErr); } ``` # 交易中組件使用方式 ![](https://img.kancloud.cn/d4/36/d4363ab5d849e5f7eafaf23cd3c288ff_1868x890.png) # 參數說明及示例 ## 入口參數 待編碼數據(byte數組或文件名):輸入一個 byte 數組或者文件絕對路徑,示例: `"D:\\work\\CQYY\\workspace\\123.txt"` 是否是文件:設置是否是文件,示例: `true` 字符串編碼(UTF-8或GBK):設置編碼格式,示例: `"utf-8"` ## 出口參數 MD5簽名內容:經過編碼后的內容,示例: `__INNER__["result"]`
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看