js实现md5加密

先下载md5.js

调用方式如下:

文件名:MD5_TestDemo.html

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>
<script type="text/javascript" src="md5.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
 function md5() {
  var result = hex_md5(document.getElementById("in").value);
  document.getElementById("out").value = result;
 }

//-->
</SCRIPT>
 <BODY>
  input:<INPUT TYPE="text" NAME="in">
  <br>
  <INPUT TYPE="button" VALUE="createMD5" ONCLICK="md5()">
  <br>
  result:<INPUT TYPE="text" NAME="out">
  <br>

 </BODY>
</HTML>

你可能感兴趣的:(JavaScript,html)