--- a/src/string.cpp Sat Jan 13 13:33:36 2007 +0000
+++ b/src/string.cpp Sat Jan 13 13:47:57 2007 +0000
@@ -177,6 +177,24 @@
#endif /* WIN32 */
+/** Convert the md5sum to a hexadecimal string representation
+ * @param buf buffer to put the md5sum into
+ * @param last last character of buffer (usually lastof(buf))
+ * @param md5sum the md5sum itself
+ * @return a pointer to the next character after the md5sum */
+char *md5sumToString(char *buf, const char *last, const uint8 md5sum[16])
+{
+ char *p = buf;
+
+ for (uint i = 0; i < 16; i++) {
+ p += snprintf(p, last + 1 - p, "%02X", md5sum[i]);
+ if (p >= last) break;
+ }
+
+ return p;
+}
+
+
/* UTF-8 handling routines */