MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / MD5End

Function MD5End

util/md5hl.c:59–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57#include "./md5.h"
58
59static char *MD5End(MD5_CTX *ctx, char *buf)
60{
61 int i;
62 unsigned char digest[LENGTH];
63 static const char hex[] = "0123456789abcdef";
64
65 if (!buf)
66 buf = malloc(2 * LENGTH + 1);
67 if (!buf)
68 return 0;
69 MD5Final(digest, ctx);
70 for (i = 0; i < LENGTH; i++) {
71 buf[i + i] = hex[digest[i] >> 4];
72 buf[i + i + 1] = hex[digest[i] & 0x0f];
73 }
74 buf[i + i] = '\0';
75 return buf;
76}
77
78char *MD5File(const char *filename, char *buf)
79{

Callers 1

MD5FileChunkFunction · 0.85

Calls 1

MD5FinalFunction · 0.85

Tested by

no test coverage detected