更改文件名会影响文件的MD5哈希吗?
问题描述:
更改文件名会影响文件的MD5哈希值吗?
Will changing a file name effect the MD5 Hash of a file?
答
仅在哈希计算中包含文件名时.例如,使用伪代码:
Only if the file's name was included in the hash calculation. e.g., in pseudo-code:
$hash1 = md5(contents of file);
$hash2 = md5(name of file + contents of file);
将产生两个单独的哈希.
will produce two seperate hashes.