tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Ostermiller Utilities > MD5 Hash

MD5 Hash 

Ostermiller Java Utilities contain various components such as CSV parsing, Base64 Encoding, MD5 digest, String and Exec Helper classes. This requires the library ostermillerutils-1.08.01.jar to be in classpath. The following example shows getting MD5 hash using MD5.getHashString() API.

File Name  :  
com/bethecoder/tutorials/ostermillerutils/MD5Test.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.ostermillerutils;

import java.io.UnsupportedEncodingException;

import com.Ostermiller.util.MD5;

public class MD5Test {

  /**
   @param args
   @throws UnsupportedEncodingException 
   */
  public static void main(String[] argsthrows UnsupportedEncodingException {

    String hash = MD5.getHashString("BE THE CODER");
    System.out.println(hash);
    
    hash = MD5.getHashString("BE THE CODER""UTF-8");
    System.out.println(hash);
    
    hash = MD5.getHashString("JAVA".getBytes());
    System.out.println(hash);
  }

}
   

It gives the following output,
30034167ecad29bc1c7d86f1629ca986
30034167ecad29bc1c7d86f1629ca986
c71e8d17d41c21de0d260881d69662ff



 
  


  
bl  br