(buffer: ArrayBuffer)
| 410 | } |
| 411 | |
| 412 | function arrayBufferToDecimal(buffer: ArrayBuffer) { |
| 413 | const byteArray = new Uint8Array(buffer) // Create a typed array from the ArrayBuffer |
| 414 | const hexArray = Array.from(byteArray, (byte) => { |
| 415 | return byte.toString(10).padStart(2, '0') // Convert each byte to a 2-digit hex string |
| 416 | }) |
| 417 | return hexArray.join('') // Join all hex strings into a single string |
| 418 | } |