The hash comes first in the filename, so hashes in the filename won't interfere with this (and as Christopher said, if what is extracted is not a valid hash - ie a request for a non hashed asset comes in - then it won't validate as an existing hash and so fallback to serving the filename as is).