Hi there,
I have an array of bytes which its length in 12.
I need to analyse these bytes and have some logic run if a certain byte sequence occurs.
I only need to analyse bytes with indicies: 1,2 & 3 where byte(11) = 1 as the rest of the bytes are the same.
======
So how would you analyse it? I mean, if i was to do it I would probably add all the possible byte combinations to 3 lists at runtime (1 byte in each list). Then search the first list for the indicies with byte(1) in it, then out of the indexs return from the matches in the first list, search the second list and then do the same for the third so you end up with 1 index and you can use that in a switch statement to run that logic.
Hope that makes sense? Is there a faster way to do it with better performance/fewer cpu cycles needed?
Thanks.
I have an array of bytes which its length in 12.
I need to analyse these bytes and have some logic run if a certain byte sequence occurs.
I only need to analyse bytes with indicies: 1,2 & 3 where byte(11) = 1 as the rest of the bytes are the same.
======
So how would you analyse it? I mean, if i was to do it I would probably add all the possible byte combinations to 3 lists at runtime (1 byte in each list). Then search the first list for the indicies with byte(1) in it, then out of the indexs return from the matches in the first list, search the second list and then do the same for the third so you end up with 1 index and you can use that in a switch statement to run that logic.
Hope that makes sense? Is there a faster way to do it with better performance/fewer cpu cycles needed?
Thanks.
Last edited: