js:(jsp页面引入md5.js文件) var mobile=$("input[name='mobile']").val(); var hash1=hex_md5(mobile); $("input[name='hidmobile']").val(hash1); var password=document.getElementById("password").value; var hash2=hex_md5(password); $("input[ name='hidpassword']")
平时用的md5+sha1加密的js文件,用法:
var hash = hex_md5(name+" "+password);
var date = new Date();//可以传时间,也可以不传,不传的话就是默认的当前时间
var time3 = Date.parse(date);
var sha1 = hex_sha1(hash+" "+time3);
/*
* A Javascr ipt implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Dis