* lua_apr_md5; r:md5(string) - Calculates an MD5 digest of a string */
| 949 | * lua_apr_md5; r:md5(string) - Calculates an MD5 digest of a string |
| 950 | */ |
| 951 | static 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 |
nothing calls this directly
no test coverage detected