Check if hashes for each file exist in database.

Check also if file name is valid utf8 string