/* Return the 128-bit message digest into the user's array  */
EXP_FUNC void STDCALL ICACHE_FLASH_ATTR MD5_Final(uint8_t *digest, MD5_CTX *ctx)
/* Return the 128-bit message digest into the user's array  */
EXP_FUNC void STDCALL ICACHE_FLASH_ATTR MD5_Final(uint8_t *digest, MD5_CTX *ctx)
{
    uint8_t bits[8];
    uint32_t x, padLen;
    Encode(bits, ctx->count, 8);
    x = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
    padLen = (x < 56) ? (56 - x) : (120 - x);
    MD5_Update(ctx, PADDING, padLen);
    MD5_Update(ctx, bits, 8);
    Encode(digest, ctx->state, MD5_SIZE);
}