w-ui-v1 1.1.16 → 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 +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
package/utils/nfc.ts CHANGED
@@ -201,16 +201,30 @@ function __read(intent) {
201
201
  // }
202
202
  // return out;
203
203
  // }
204
+ // function bytesToDecimalString(inarray) {
205
+ // let result = BigInt(0);
206
+ // // 反转数组以适配大端序
207
+ // const reversed = [...inarray].reverse();
208
+ // for (let j = 0; j < reversed.length; j++) {
209
+ // const byte = BigInt(parseInt(reversed[j])) & BigInt(0xff);
210
+ // result = (result << BigInt(8)) | byte;
211
+ // }
212
+ // return result.toString();
213
+ // }
214
+
204
215
  function bytesToDecimalString(inarray) {
205
216
  let result = BigInt(0);
217
+ let resultStr=""
206
218
  // 反转数组以适配大端序
207
219
  const reversed = [...inarray].reverse();
208
220
  for (let j = 0; j < reversed.length; j++) {
209
221
  const byte = BigInt(parseInt(reversed[j])) & BigInt(0xff);
222
+ resultStr=resultStr+((result << BigInt(8)) | byte)
210
223
  result = (result << BigInt(8)) | byte;
211
224
  }
212
- return result.toString();
225
+ return resultStr;
213
226
  }
227
+
214
228
 
215
229
  function reverseTwo(str) {
216
230