apr_snprintf(..., "%02X" for each character.
Output is *not* exactly the same. It was uppercase, now it is lowercase.
According to my understanding, this is not an issue.
Should it be, a call to ap_str_toupper should be added.
The speedup would be less, but still significant.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1429561 13f79535-47bb-0310-9956-
ffa450edef68
char *key, apr_size_t keylen)
{
char *cp;
- unsigned int n;
if (idlen * 2 + ctx->taglen >= keylen)
return 1;
cp = apr_cpystrn(key, ctx->tag, ctx->taglen);
+ ap_bin2hex(id, idlen, cp);
- for (n = 0; n < idlen; n++) {
- apr_snprintf(cp, 3, "%02X", (unsigned) id[n]);
- cp += 2;
- }
-
- *cp = '\0';
return 0;
}