What are the best practices for generating a unique hash in PHP for file manipulation purposes?

When working with files in PHP, it is often necessary to generate a unique hash to ensure file integrity and prevent naming conflicts. One common approach is to use the `md5()` function along with a combination of file properties like name, size, and timestamp to create a unique hash.

// Generate a unique hash for file manipulation purposes
function generateUniqueHash($file_path) {
    $file_info = pathinfo($file_path);
    $hash = md5($file_info['basename'] . $file_info['size'] . filemtime($file_path));
    return $hash;
}

// Example of generating a unique hash for a file
$file_path = 'path/to/file.txt';
$unique_hash = generateUniqueHash($file_path);
echo $unique_hash;