]>
git.ipfire.org Git - thirdparty/squid.git/blob - lib/md5-test.c
7 * gcc -Wall md5-test.c -I../include md5.o
14 static void MDPrint(unsigned char digest
[16]);
15 static void MDString(char *string
);
18 MDString(char *string
)
21 unsigned char digest
[16];
22 unsigned int len
= strlen(string
);
24 xMD5Update(&context
, string
, len
);
25 xMD5Final(digest
, &context
);
26 printf("MD5 (\"%s\") = ", string
);
32 MDPrint(unsigned char digest
[16])
35 for (i
= 0; i
< 16; i
++)
36 printf("%02x", digest
[i
]);
40 main(int argc
, char **argv
)
42 printf("MD5 test suite:\n");
46 MDString("message digest");
47 MDString("abcdefghijklmnopqrstuvwxyz");
48 MDString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
49 MDString("1234567890123456789012345678901234567890"
50 "1234567890123456789012345678901234567890");