<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 組件源碼 ``` /** * <b>方法描述:</b> 獲取CRC16碼 <br/> * <b>創建者:</b> admin <br/> * <b>創建時間:</b> 2018-04-16 11:20:59 <br/> * * @param str * 入參|輸入校驗字符串|{@link java.lang.String} * @param code * 出參|校驗碼|{@link java.lang.String} * @return 0 失敗<br/> * 1 成功<br/> */ @Component(label = "獲取CRC16碼", style = "判斷型", type = "同步組件", version = "1.0.0", deprecated = false, author = "admin", date = "2018-04-16 11:20:59") @InParams(param = { @Param(name = "str", comment = "輸入校驗字符串", type = java.lang.String.class) }) @OutParams(param = { @Param(name = "code", comment = "校驗碼", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "0", desp = "失敗"), @Return(id = "1", desp = "成功") }) public static ResultBase P_getCrc16(String str) { if (StringUtil.isBlank(str)) return ResultBase.newFailureResult("TPTS0007", "校驗數據參數不能為空"); byte[] data = str.getBytes(); int high; int flag; // 16位寄存器,所有數位均為1 int wcrc = 0xffff; for (int i = 0; i < data.length; i++) { // 16 位寄存器的高位字節 high = wcrc >> 8; // 取被校驗串的一個字節與 16 位寄存器的高位字節進行“異或”運算 wcrc = high ^ data[i]; for (int j = 0; j < 8; j++) { flag = wcrc & 0x0001; // 把這個 16 寄存器向右移一位 wcrc = wcrc >> 1; // 若向右(標記位)移出的數位是 1,則生成多項式 1010 0000 0000 0001 和這個寄存器進行“異或”運算 if (flag == 1) wcrc ^= 0xa001; } } return ResultBase.newSuccessResult(Integer.toHexString(wcrc)); } ``` # 交易中組件使用方式 ![](https://img.kancloud.cn/c3/b8/c3b84f8b777ddadfd5c3babe328e4bf1_1869x892.png) # 參數說明及示例 ## 入口參數 輸入校驗字符串:輸入字符串,示例: `"abc"` ## 出口參數 校驗碼:返回經過運算后的校驗碼,示例: `__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>

                              哎呀哎呀视频在线观看