Post AapwWscSa9qKr3VfiS by lamp@kitty.haus
(DIR) More posts by lamp@kitty.haus
(DIR) Post #Aap0TECr7YXhi2GqS8 by lamp@kitty.haus
2023-10-16T08:13:54.318210Z
0 likes, 0 repeats
How to find index of a set of bytes in a byte array? Do I have to just iterate and check next n bytes from each byte?Like suppose I have Uint8Array [5,5,5,1,2,3,4,5,5] and I want to find index of [1,2,3,4] (which is 3)Basically I want to split one big ass concatenation of binary using a unique delimiter between them
(DIR) Post #Aap35Cdfb4lvlC33QW by fraca7@social.linux.pizza
2023-10-16T08:38:01Z
1 likes, 0 repeats
@lamp Check out https://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm it's basically a very compact representation for a "constant" regular expression
(DIR) Post #AapwWscSa9qKr3VfiS by lamp@kitty.haus
2023-10-16T19:04:28.597738Z
0 likes, 0 repeats
@niconiconi oh that's good idea cause ascii just maps one char per byte right; i tried reading as utf8 in text editor but couldnt see my delimiters i guess because of byte alignment.but i found better way so i dont need to do this anymore