V
Vince Panuccio
Hello,
If im looking for a pattern of byes in a byte array, what would be the
best approach?
I could convert the array into a string and use IndexOf recursivly by
remembering the last position I encountered a match, but it seems to
be the wrong way to go about it, especially if I have an array a
couple of MB in size.
My initial thoughts are to just use a for loop and check for a byte
matching the first instance of the search pattern.
For example
asodaiudoqiiqmngm,3n23n4234kj23rasdrwebHelloWorldkajsdiouahsd
My way of doing this would be to look for 'H' and then check every
character after that using a bunch of If's.
Is there a built in method or an algorithm I could use? Google has not
helped.
Cheers
If im looking for a pattern of byes in a byte array, what would be the
best approach?
I could convert the array into a string and use IndexOf recursivly by
remembering the last position I encountered a match, but it seems to
be the wrong way to go about it, especially if I have an array a
couple of MB in size.
My initial thoughts are to just use a for loop and check for a byte
matching the first instance of the search pattern.
For example
asodaiudoqiiqmngm,3n23n4234kj23rasdrwebHelloWorldkajsdiouahsd
My way of doing this would be to look for 'H' and then check every
character after that using a bunch of If's.
Is there a built in method or an algorithm I could use? Google has not
helped.
Cheers