MD5 Hash Generator jQuery Plugin – jquery.md5.js

In this tutorial I am going to share simple jQuery plugin which generate MD5 hash from string. Which you can use in javascript based project. jquery.md5.js is a lightweight, jQuery-based, client-side MD5 generator that generates an MD5 hash from any string you specify.Used for encrypting the password, credit card, and other private data when stored in the database.


Libraries

Include jquery.md5.js library on page along with jquery core library.

<script src="//code.jquery.com/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="jquery.md5.min.js" type="text/javascript" charset="utf-8"></script>

HTML

For demo purpose created to text box one for input and other will display MD5 hash as output.

 <label for="input">Input: </label><textarea name="input" rows="8" cols="40" id="input">Hello World!</textarea>
  <hr>
  <input type="button" name="md5" id="md5" value="MD5">
  <hr>
  <label for="output">Output: </label><textarea name="output" rows="8" cols="40" id="output"></textarea>



JS

string jQuery.MD5( string ) input string and return string The $.MD5() function convert string to MD5

 jQuery(document).ready(function($) {
      $('#md5').click(function(){
        $('#output').val($.MD5($('#input').val()));
      });
    });

See live demo and download source code.

DEMO | DOWNLOAD

This awesome plugin is developed by winai543. Visit their official github repository for more information and follow for future updates.