我想计算文件的md5sum值,而不是字符串。我发现有人使用过openssl md5函数。但它只用在字符串中。是否有任何函数可用于获取文件的md5sum值,该值等于在linux中使用md5sum命令。
答案 0 :(得分:2)
您可以使用 openssl / md5.h 生成md5sum 请参阅How to get the MD5 hash of a file in C++?
在此链接示例中提供了使用openssl生成文件的md5sum
此外,您可以在Linux中使用以下命令生成文件的md5sum
openssl dgst -md5 yourfile
md5sum yourfile