* Converts Uint8Array to Uint32Array * * @param {Uint8Array} u8Array Uint8Array to convert * @returns {Uint32Array} - Required Uint32Array
(u8Array)
| 62 | * @returns {Uint32Array} - Required Uint32Array |
| 63 | */ |
| 64 | function u8ToU32(u8Array) { |
| 65 | const uint32Array = new Uint32Array(u8Array.length / 4) |
| 66 | |
| 67 | for (let i = 0; i < u8Array.length; i += 4) { |
| 68 | uint32Array[i / 4] = |
| 69 | (u8Array[i] | |
| 70 | (u8Array[i + 1] << 8) | |
| 71 | (u8Array[i + 2] << 16) | |
| 72 | (u8Array[i + 3] << 24)) >>> |
| 73 | 0 |
| 74 | } |
| 75 | |
| 76 | return uint32Array |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Converts Uint32Array to Uint8Array |