You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a file that is binary and I want to encrypt it. However, when converting from an ArrayBuffer to a wordArray, an error occurs. export function arrayBufferToWordArray(ab: ArrayBuffer) { var i8a = new Uint8Array(ab); var a: number[] = []; for (var i = 0; i < i8a.length; i += 4) { var word = 0; for (var j = 0; j < 4 && i + j < i8a.length; j++) { word |= i8a[i + j] << (24 - j * 8); } a.push(word); // a.push((i8a[i] << 24) | (i8a[i + 1] << 16) | (i8a[i + 2] << 8) | i8a[i + 3]); } }
Array a will display Invalid array length
The text was updated successfully, but these errors were encountered:
I have a file that is binary and I want to encrypt it. However, when converting from an ArrayBuffer to a wordArray, an error occurs.
export function arrayBufferToWordArray(ab: ArrayBuffer) { var i8a = new Uint8Array(ab); var a: number[] = []; for (var i = 0; i < i8a.length; i += 4) { var word = 0; for (var j = 0; j < 4 && i + j < i8a.length; j++) { word |= i8a[i + j] << (24 - j * 8); } a.push(word); // a.push((i8a[i] << 24) | (i8a[i + 1] << 16) | (i8a[i + 2] << 8) | i8a[i + 3]); } }
Array a will display Invalid array length
The text was updated successfully, but these errors were encountered: