Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var reader = new FileReader();
- reader.onload = (e) => {
- var hash = CryptoJS.SHA1(this.arrayBufferToWordArray(e.target.result)).toString();
- }
- reader.readAsArrayBuffer(this.profile_file);
- arrayBufferToWordArray:function(ab) {
- var i8a = new Uint8Array(ab);
- var a = [];
- for (var i = 0; i < i8a.length; i += 4) {
- a.push(i8a[i] << 24 | i8a[i + 1] << 16 | i8a[i + 2] << 8 | i8a[i + 3]);
- }
- return CryptoJS.lib.WordArray.create(a, i8a.length);
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement