I have some binary data loaded from a file which includes strings but mixed with binary data and created a DataView of it.
I want to find out which, if any, of an array of strings are present in a specific range of that data, and add those that are to an array.
function findStrings(data, startIdx, endIdx, matchStrings) {
let returnStrings = [];
...
return returnStrings;
}
The strings may be surrounded by any 8 bit code.
The data might be up to 1 Mb. matchStrings is likely to contain 10-100 strings.
Using a regular expression or searching in multiple passes seems very inefficient, so not sure how to approach it, particularly with need to ignore non-ascii characters.