📄 md5_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
public final class md5_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\r');
out.write('\n');
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
out.write("<html>\r\n");
out.write("\t<head>\r\n");
out.write("\t\t<base href=\"");
out.print(basePath);
out.write("\">\r\n");
out.write("\r\n");
out.write("\t\t<title>My JSP 'md5.jsp' starting page</title>\r\n");
out.write("\r\n");
out.write("\t</head>\r\n");
out.write("\r\n");
out.write("\t<body>\r\n");
out.write("\t\t<input id=test value=webasp>\r\n");
out.write("\t\t<input type=button value=md5 onclick=\"alert(hex_md5(test.value))\">\r\n");
out.write("\r\n");
out.write("\t\t<script> \r\n");
out.write("var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ \r\n");
out.write("var b64pad = \"\"; /* base-64 pad character. \"=\" for strict RFC compliance */ \r\n");
out.write("var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ \r\n");
out.write("\r\n");
out.write("/* \r\n");
out.write("* These are the functions you'll usually want to call \r\n");
out.write("* They take string arguments and return either hex or base-64 encoded strings \r\n");
out.write("*/ \r\n");
out.write("function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} \r\n");
out.write("function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} \r\n");
out.write("function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } \r\n");
out.write("function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } \r\n");
out.write("\r\n");
out.write("/* Backwards compatibility - same as hex_md5() */ \r\n");
out.write("function calcMD5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} \r\n");
out.write("\r\n");
out.write("/* \r\n");
out.write("* Perform a simple self-test to see if the VM is working \r\n");
out.write("*/ \r\n");
out.write("function md5_vm_test() \r\n");
out.write("{ \r\n");
out.write("return hex_md5(\"abc\") == \"900150983cd24fb0d6963f7d28e17f72\"; \r\n");
out.write("} \r\n");
out.write("\r\n");
out.write("/* \r\n");
out.write("* Calculate the MD5 of an array of little-endian words, and a bit length \r\n");
out.write("*/ \r\n");
out.write("function core_md5(x, len) \r\n");
out.write("{ \r\n");
out.write("/* append padding */ \r\n");
out.write("x[len >> 5] |= 0x80 << ((len) % 32); \r\n");
out.write("x[(((len + 64) >>> 9) << 4) + 14] = len; \r\n");
out.write("\r\n");
out.write("var a = 1732584193; \r\n");
out.write("var b = -271733879; \r\n");
out.write("var c = -1732584194; \r\n");
out.write("var d = 271733878; \r\n");
out.write("\r\n");
out.write("for(var i = 0; i < x.length; i += 16) \r\n");
out.write("{ \r\n");
out.write("var olda = a; \r\n");
out.write("var oldb = b; \r\n");
out.write("var oldc = c; \r\n");
out.write("var oldd = d; \r\n");
out.write("\r\n");
out.write("a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); \r\n");
out.write("d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); \r\n");
out.write("c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); \r\n");
out.write("b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); \r\n");
out.write("a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); \r\n");
out.write("d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); \r\n");
out.write("c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); \r\n");
out.write("b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); \r\n");
out.write("a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); \r\n");
out.write("d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); \r\n");
out.write("c = md5_ff(c, d, a, b, x[i+10], 17, -42063); \r\n");
out.write("b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); \r\n");
out.write("a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); \r\n");
out.write("d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); \r\n");
out.write("c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); \r\n");
out.write("b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); \r\n");
out.write("\r\n");
out.write("a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); \r\n");
out.write("d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); \r\n");
out.write("c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); \r\n");
out.write("b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); \r\n");
out.write("a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); \r\n");
out.write("d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); \r\n");
out.write("c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); \r\n");
out.write("b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); \r\n");
out.write("a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); \r\n");
out.write("d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); \r\n");
out.write("c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); \r\n");
out.write("b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); \r\n");
out.write("a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); \r\n");
out.write("d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); \r\n");
out.write("c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); \r\n");
out.write("b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); \r\n");
out.write("\r\n");
out.write("a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); \r\n");
out.write("d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); \r\n");
out.write("c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); \r\n");
out.write("b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); \r\n");
out.write("a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); \r\n");
out.write("d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); \r\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -