MD5 library setup and config examples


If you are asking a question, please follow this template:

  1. My goal is: [describe your goal]
    Hash a string using MD5

  2. My actions are: [describe your actions - code, commands, etc]
    looking for documentation

  3. The result I see is: [show the result - log, etc]

  4. My expectation & question is: [describe your expectation and your question]
    Is there a library for MD5 and any special setup to include it in the build process?

#include "mbedtls/md5.h"

bool make_uuid_md5(const char* name, char* uuid, size_t uuid_len) {
  mbedtls_md5_context ctx;
  mbedtls_md5_update(&ctx, (const uint8_t*) name, strlen(name));

  uint8_t hash[16];
  mbedtls_md5_finish(&ctx, hash);

  uuid_from_hash(hash, uuid, uuid_len);
  LOG(LL_INFO, ("uuid_md5: %s", uuid));

  return true;