MCPcopy Create free account
hub / github.com/apache/httpd / sha1_func

Function sha1_func

server/util_expr_eval.c:1079–1095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1077}
1078
1079static const char *sha1_func(ap_expr_eval_ctx_t *ctx, const void *data,
1080 const char *arg)
1081{
1082 apr_sha1_ctx_t context;
1083 apr_byte_t sha1[APR_SHA1_DIGESTSIZE];
1084 char *out;
1085
1086 out = apr_palloc(ctx->p, APR_SHA1_DIGESTSIZE*2+1);
1087
1088 apr_sha1_init(&context);
1089 apr_sha1_update(&context, arg, (unsigned int)strlen(arg));
1090 apr_sha1_final(sha1, &context);
1091
1092 ap_bin2hex(sha1, APR_SHA1_DIGESTSIZE, out);
1093
1094 return out;
1095}
1096
1097static const char *md5_func(ap_expr_eval_ctx_t *ctx, const void *data,
1098 const char *arg)

Callers

nothing calls this directly

Calls 1

ap_bin2hexFunction · 0.85

Tested by

no test coverage detected