Javascript MD5
Compute a MD5 hash
HTML
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js"></script>
<h3>Compute MD5</h3>
<label for="msg">Message</label>
<input id="msg" type="text" size="50"></input>
<br />
<button id="compute">Compute</button>
<hr />
<label for="hash">Hash Code</label>
<input id="hash" type="text" readonly="readonly" size="50" />
JavaScript
$("#compute").on("click", function(e) {
computeHash();
});
function computeHash() {
var message = $("#msg").val();
var d = new Date(); // Todays Date
var today_date =
d.getUTCFullYear() + "-" +
("0" + (d.getUTCMonth() + 1)).slice(-2) + "-" +
("0" + d.getUTCDate()).slice(-2);
var hash = CryptoJS.MD5(message + today_date);
console.log(message,hash);
$("#hash").val(hash);
}