VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

InBArr and InBArrRev searching strings from a byte array

Vesa Piittinen  (20 Submissions)   Miscellaneous   VB Script   Advanced   Wed 3rd February 2021

This code seeks from the end of a byte array trying to find a matching text. Why? Well, handling byte arrays is much faster than handling strings. So, if you needed to parse data real fast and a lot, it would be benefical to do it using a byte array instead of a string.
My starting point to this was rather simple: do the search faster than InStr and InStrRev. Beating the latter was easy: InStrRev isn't of the fastest build-in functions in VB. With InStr I had to taste half of a defeat: it just is superb when it can search in BinaryCompare. But, what if we wanted to do TextCompare? Well, there InBArr and InBArrRev beat real badly both InStr and InStrRev!
Anyways, I hope somebody finds this submission helpful. I'm sorry I didn't comment the code as well as I could/should have, but I hope it doesn't matter as the code should be rather flawless on what it does :) Comments and votes welcome, as always!

Rate InBArr and InBArrRev searching strings from a byte array (3(3 Vote))

Download InBArr and InBArrRev searching strings from a byte array

InBArr and InBArrRev searching strings from a byte array Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters