]> sjero.net Git - wget/commitdiff
[svn] Debugging function.
authorhniksic <devnull@localhost>
Thu, 29 Nov 2001 14:57:30 +0000 (06:57 -0800)
committerhniksic <devnull@localhost>
Thu, 29 Nov 2001 14:57:30 +0000 (06:57 -0800)
src/utils.c

index ac3567330419d2546c403525e9be65eb5a9eda6e..44b73d69c5234ea20acee418693234268460d9ce 100644 (file)
@@ -1771,3 +1771,35 @@ determine_screen_width (void)
   return wsz.ws_col;
 #endif /* TIOCGWINSZ */
 }
+
+#if 0
+/* A debugging function for checking whether an MD5 library works. */
+
+char *
+debug_test_md5 (char *buf)
+{
+  unsigned char raw[16];
+  static char res[33];
+  unsigned char *p1;
+  char *p2;
+  int cnt;
+  MD5_CONTEXT_TYPE ctx;
+
+  MD5_INIT (&ctx);
+  MD5_UPDATE (buf, strlen (buf), &ctx);
+  MD5_FINISH (&ctx, raw);
+
+  p1 = raw;
+  p2 = res;
+  cnt = 16;
+  while (cnt--)
+    {
+      *p2++ = XDIGIT_TO_xchar (*p1 >> 4);
+      *p2++ = XDIGIT_TO_xchar (*p1 & 0xf);
+      ++p1;
+    }
+  *p2 = '\0';
+
+  return res;
+}
+#endif