]> Pileus Git - ~andy/fetchmail/blob - md5ify.c
Fix typo repsonsible -> responsible.
[~andy/fetchmail] / md5ify.c
1 /*
2  * For license terms, see the file COPYING in this directory.
3  */
4
5 /***********************************************************************
6   module:       md5ify.c
7   project:      fetchmail
8   programmer:   Carl Harris, ceharris@mal.com
9   description:  Simple interface to MD5 module.
10
11  ***********************************************************************/
12
13 #include <stdio.h>
14 #include <string.h>
15 #include <string.h>
16
17 #include "fetchmail.h"
18 #include "fm_md5.h"
19
20 char *
21 MD5Digest (unsigned const char *s)
22 {
23   int i;
24   MD5_CTX context;
25   unsigned char digest[16];
26   static char ascii_digest [33];
27
28   MD5Init(&context);
29   MD5Update(&context, s, strlen((const char *)s));
30   MD5Final(digest, &context);
31
32   for (i = 0;  i < 16;  i++) 
33     sprintf(ascii_digest+2*i, "%02x", digest[i]);
34  
35   return(ascii_digest);
36 }