From e4c0e55b9a9f73411c60ae8370a0be3c50cd8cec Mon Sep 17 00:00:00 2001 From: jakani24 Date: Sun, 9 Jun 2024 10:42:16 +0200 Subject: [PATCH] Delete md5.cpp --- src/test/md5.cpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/test/md5.cpp diff --git a/src/test/md5.cpp b/src/test/md5.cpp deleted file mode 100644 index 1c52dab..0000000 --- a/src/test/md5.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include -#include - -int main() { - // Open the file for reading - std::ifstream file("your_file_path", std::ios::binary); - if (!file) { - std::cerr << "Error opening file." << std::endl; - return 1; - } - - // Initialize the MD5 context - MD5_CTX md5Context; - MD5_Init(&md5Context); - - // Read the file in chunks and update the MD5 context - char buffer[1024]; - while (file.read(buffer, sizeof(buffer))) { - MD5_Update(&md5Context, buffer, file.gcount()); - } - - // Finalize the MD5 hash - unsigned char md5Digest[MD5_DIGEST_LENGTH]; - MD5_Final(md5Digest, &md5Context); - - // Print the MD5 hash - std::cout << "MD5 Hash: "; - for (int i = 0; i < MD5_DIGEST_LENGTH; ++i) { - printf("%02x", md5Digest[i]); - } - std::cout << std::endl; - - // Close the file - file.close(); - - return 0; -}