w-ui-v1 1.1.17 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/nfc.ts +13 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.1.17",
3
+ "version": "1.1.18",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
package/utils/nfc.ts CHANGED
@@ -211,17 +211,20 @@ function __read(intent) {
211
211
  // }
212
212
  // return result.toString();
213
213
  // }
214
- function bytesToDecimalString(inarray) {
215
- let result = '';
216
- // 处理每个字节(保持原始顺序)
217
- for (let j = 0; j < inarray.length; j++) {
218
- // 解析当前字节值并确保在0-255范围内
219
- const byteValue = parseInt(inarray[j]) & 0xFF;
220
- // 转换为三位字符串(不足三位补零)
221
- result += byteValue.toString().padStart(3, '0');
222
- }
223
- return result;
214
+
215
+ function bytesToDecimalString(inarray) {
216
+ let result = BigInt(0);
217
+ let resultStr=""
218
+ // 反转数组以适配大端序
219
+ const reversed = [...inarray].reverse();
220
+ for (let j = 0; j < reversed.length; j++) {
221
+ const byte = BigInt(parseInt(reversed[j])) & BigInt(0xff);
222
+ resultStr=resultStr+((result << BigInt(8)) | byte)
223
+ result = (result << BigInt(8)) | byte;
224
+ }
225
+ return resultStr;
224
226
  }
227
+
225
228
 
226
229
  function reverseTwo(str) {
227
230