I need to compare certain binary files in as fast of a way as possible. I will already know the following their exact size in bytes (I'll already know that the two files have exactly the same size and CRC32) - I cannot simply accept the crc32 match as final proof in this case, however - there has to be an actual comparison of all data.
The files can in some cases be too large to load entirely into memory all at once (such as iso files, large zips/rars, etc).
I was wondering if anyone has any code to do this already in PB. Also, what is the fastest way to compare to byte arrays or memory buffers of the same size? Is there any good assembler to do this that is faster than looping through and comparing each element of a byte array? Does PB have any built in functions that would be useful in this case (such as string compare functions)?
If using string compare type functionality, it would have to not die on nul-terminators within the 'string,' which would actually be binary data.
Thanks to anyone with any ideas.
The files can in some cases be too large to load entirely into memory all at once (such as iso files, large zips/rars, etc).
I was wondering if anyone has any code to do this already in PB. Also, what is the fastest way to compare to byte arrays or memory buffers of the same size? Is there any good assembler to do this that is faster than looping through and comparing each element of a byte array? Does PB have any built in functions that would be useful in this case (such as string compare functions)?
If using string compare type functionality, it would have to not die on nul-terminators within the 'string,' which would actually be binary data.
Thanks to anyone with any ideas.
Comment