md5 — returns an MD5 hash of the buffer provided.
#include "libc/include/crypto/md5.h"
MD5Result* md5(const char *initial_msg, size_t initial_len);
void md5_print(MD5Result *md5_hash);The md5() function takes a const char * of the message to be hashed as its first parameter, and a second parameter that indicates the length of the message. It then returns an MD5Result struct, which contains 4 uint32_ts that contain the 128-bit hash in 32-bit components.
The md5() function returns a pointer to an MD5Result struct, which contains 4 uint32_ts. This must be freed.
MD5Result* md5_result = md5("hello", 5);
md5_print(md5_result); // prints 5d41402abc4b2a76b9719d911017c592See GitHub Issues: https://github.com/takashiidobe/libc/issues
Takashi Idobe mail@takashiidobe.com