Browse Source

mg_md5 made public

Sergey Lyubka 15 years ago
parent
commit
627a6dbb5a
2 changed files with 12 additions and 1 deletions
  1. 1 1
      mongoose.c
  2. 11 0
      mongoose.h

+ 1 - 1
mongoose.c

@@ -2120,7 +2120,7 @@ bin2str(char *to, const unsigned char *p, size_t len)
  * Return stringified MD5 hash for list of vectors.
  * Return stringified MD5 hash for list of vectors.
  * buf must point to 33-bytes long buffer
  * buf must point to 33-bytes long buffer
  */
  */
-static void
+void
 mg_md5(char *buf, ...)
 mg_md5(char *buf, ...)
 {
 {
 	unsigned char	hash[16];
 	unsigned char	hash[16];

+ 11 - 0
mongoose.h

@@ -237,6 +237,17 @@ const char *mg_version(void);
 
 
 
 
 /*
 /*
+ * MD5 hash given strings.
+ * Buffer 'buf' must be 33 bytes long. Varargs is a NULL terminated list of
+ * asciiz strings. When function returns, buf will contain human-readable
+ * MD5 hash. Example:
+ *   char buf[33];
+ *   mg_md5(buf, "aa", "bb", NULL);
+ */
+void mg_md5(char *buf, ...);
+
+
+/*
  * Print command line usage string.
  * Print command line usage string.
  */
  */
 void mg_show_usage_string(FILE *fp);
 void mg_show_usage_string(FILE *fp);