refactored dir_hash for readability
refactored dir_hash for readability