Depends on your definition of simple.
There is this GitHub project which identifies quite a range of filetypes by file signature header bytes.
Identify a file via MIME type and file signature detection. - Tinram/File-Identifier
github.com
It is in PHP, but could be converted.
Seems to cover 60 different file types.