[Tutor] Search for hex data in file

xbmuncher xboxmuncher at gmail.com
Mon May 25 08:32:25 CEST 2009


I've been reading about ways to convert strings and what not to hex and back
and forth. I'm looking for the fastest and least memory intensive way to
search through a file for a hex value and gets its byte offset in the file.
This hex value (that I'm looking for in the file) is of course a hex
representation of the binary data and its 8 bytes long.
I figured reading the whole file and converting it to hex from ascii..etc..
would be overkill, especially if its a large file.
What do you guys recommend? I want to search the file for certain hex value
and get the byte offset within the file.

Thanks for reading.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090525/31ab509b/attachment.htm>


More information about the Tutor mailing list