Mercurial > hg > nginx
diff src/core/ngx_string.c @ 176:c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 09 Nov 2003 20:03:38 +0000 |
parents | e92c2c647c57 |
children | 87e73f067470 |
line wrap: on
line diff
--- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -71,13 +71,15 @@ int ngx_atoi(char *line, size_t n) void ngx_md5_text(char *text, u_char *md5) { - /* STUB */ + int i; + static char hex[] = "0123456789abcdef"; - ngx_snprintf(text, 33, - "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - 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]); + for (i = 0; i < 16; i++) { + *text++ = hex[md5[i] >> 4]; + *text++ = hex[md5[i] & 0xf]; + } + + *text = '\0'; }