w-ui-v1 1.1.16 → 1.1.17
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.
- package/package.json +1 -1
- package/utils/nfc.ts +20 -9
package/package.json
CHANGED
package/utils/nfc.ts
CHANGED
|
@@ -201,15 +201,26 @@ function __read(intent) {
|
|
|
201
201
|
// }
|
|
202
202
|
// return out;
|
|
203
203
|
// }
|
|
204
|
-
function bytesToDecimalString(inarray) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
+
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;
|
|
213
224
|
}
|
|
214
225
|
|
|
215
226
|
function reverseTwo(str) {
|