|
@@ -348,12 +348,12 @@ this.singlefile.lib.util = this.singlefile.lib.util || (() => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function compareBytes(mask, pattern) {
|
|
function compareBytes(mask, pattern) {
|
|
|
- let patternMatch = true;
|
|
|
|
|
|
|
+ let patternMatch = true, index = 0;
|
|
|
const value = new Uint8Array(buffer, 0, mask.length);
|
|
const value = new Uint8Array(buffer, 0, mask.length);
|
|
|
- for (let index = 0; index < mask.length && patternMatch; index++) {
|
|
|
|
|
|
|
+ for (index = 0; index < mask.length && patternMatch; index++) {
|
|
|
patternMatch = patternMatch && ((value[index] & mask[index]) == pattern[index]);
|
|
patternMatch = patternMatch && ((value[index] & mask[index]) == pattern[index]);
|
|
|
}
|
|
}
|
|
|
- return patternMatch;
|
|
|
|
|
|
|
+ return patternMatch && (index == mask.length);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|