* Compare two Uint8Arrays for content equality
(a: Uint8Array, b: Uint8Array)
| 150 | * Compare two Uint8Arrays for content equality |
| 151 | */ |
| 152 | function areUint8ArraysEqual(a: Uint8Array, b: Uint8Array): boolean { |
| 153 | if (a.byteLength !== b.byteLength) { |
| 154 | return false |
| 155 | } |
| 156 | for (let i = 0; i < a.byteLength; i++) { |
| 157 | if (a[i] !== b[i]) { |
| 158 | return false |
| 159 | } |
| 160 | } |
| 161 | return true |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Threshold for normalizing Uint8Arrays to string representations. |