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

Function lua_apr_md5

modules/lua/lua_request.c:951–964  ·  view source on GitHub ↗

* lua_apr_md5; r:md5(string) - Calculates an MD5 digest of a string */

Source from the content-addressed store, hash-verified

949 * lua_apr_md5; r:md5(string) - Calculates an MD5 digest of a string
950 */
951static int lua_apr_md5(lua_State *L)
952{
953 const char *buffer;
954 char *result;
955 size_t len;
956 request_rec *r;
957
958 r = ap_lua_check_request_rec(L, 1);
959 luaL_checktype(L, 2, LUA_TSTRING);
960 buffer = lua_tolstring(L, 2, &len);
961 result = ap_md5_binary(r->pool, (const unsigned char *)buffer, len);
962 lua_pushstring(L, result);
963 return 1;
964}
965
966/*
967 * lua_apr_sha1; r:sha1(string) - Calculates the SHA1 digest of a string

Callers

nothing calls this directly

Calls 2

ap_md5_binaryFunction · 0.85
ap_lua_check_request_recFunction · 0.70

Tested by

no test coverage detected