# C实现计算文件或字符串的md5值 **Repository Path**: ikaros-521/Compute-file-or-string-md5 ## Basic Information - **Project Name**: C实现计算文件或字符串的md5值 - **Description**: 针对文件或字符串生成md5值 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-09-22 - **Last Updated**: 2024-02-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 原项目信息 fork自 [https://github.com/chinaran/Compute-file-or-string-md5](https://github.com/chinaran/Compute-file-or-string-md5) ## 实现功能 针对文件或字符串生成md5值,文件路径最长1024字节,字符串最长1024字节。 ## 编译与使用 编译命令 `gcc main_md5.c md5.c -Wall -o md5` 针对字符串运行 `./md5 string 123` 针对文件运行 `./md5 file main_md5.c` ```bash [root@localhost]# ./md5 file main_md5.c c950c2707fa7ee8be1190037c4b9cde0 [root@localhost]# ./md5 string 123 202cb962ac59075b964b07152d234b70 ``` 可以使用`md5sum`命令进行检查 `md5sum main_md5.c` ```bash [root@localhost Compute-file-or-string-md5]# md5sum main_md5.c c950c2707fa7ee8be1190037c4b9cde0 main_md5.c ```