summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_string.c9
-rw-r--r--src/core/ngx_string.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 312e81992..a007cac79 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -69,6 +69,15 @@ int ngx_atoi(char *line, size_t n)
}
+void ngx_print_md5(char *text, u_char *md5)
+{
+ ngx_snprintf(text, 33, "%0x%0x%0x%0x%0x%0x%0x%0x%0x%0x%0x%0x%0x%0x%0x%0x",
+ md5[0], md5[1], md5[2], md5[3], md5[4], md5[5],
+ md5[6], md5[7], md5[8], md5[9], md5[10], md5[11],
+ md5[12], md5[13], md5[14], md5[15]);
+}
+
+
#if 0
char *ngx_psprintf(ngx_pool_t *p, const char *fmt, ...)
{
diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h
index 665c84450..fe60cad76 100644
--- a/src/core/ngx_string.h
+++ b/src/core/ngx_string.h
@@ -61,6 +61,9 @@ char *ngx_cpystrn(char *dst, char *src, size_t n);
int ngx_rstrncmp(char *s1, char *s2, size_t n);
int ngx_atoi(char *line, size_t n);
+void ngx_print_md5(char *text, u_char *md5);
+
+
#define ngx_qsort qsort