Is it possible to check what type of data does represent string binary file?
For example: We have binary data read from image file (f.e. example.jpg). Can we guess that this binary data represent image file? If yes, how we can do that?
Is it possible to check what type of data does represent string binary file?
For example: We have binary data read from image file (f.e. example.jpg). Can we guess that this binary data represent image file? If yes, how we can do that?
You could look at the python-magic library. It seems to do what you want (although I've never used it myself).
file command, which is about as well as anything general-purpose is going to work.