mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-30 23:38:47 +01:00
Corrected md5 hashing
This commit is contained in:
parent
9f38703e84
commit
8472e877a4
@ -83,12 +83,11 @@
|
||||
// append 10...000000
|
||||
messageByteArray[length] = 0x80;
|
||||
// append size in 64 bit big endian
|
||||
view.setUint32(neededLength - 4, messageBitLength, false);
|
||||
view.setUint32(neededLength - 8, messageBitLength, true);
|
||||
|
||||
for (var i = 0; i < neededLength; i += 64){
|
||||
var w = new Array(16);
|
||||
for (let j = 0; j < 64; j += 4){
|
||||
w[j / 4] = view.getUint32(j, false);
|
||||
w[j / 4] = view.getUint32(i + j, true);
|
||||
}
|
||||
|
||||
temp.set(h);
|
||||
@ -124,7 +123,7 @@
|
||||
const hash = new Uint8Array(16);
|
||||
const hashView = new DataView(hash.buffer);
|
||||
for (let j = 0; j < 4; j += 1){
|
||||
hashView.setUint32(j * 4, h[j], false);
|
||||
hashView.setUint32(j * 4, h[j], true);
|
||||
}
|
||||
return hash;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user