Results 1 to 1 of 1
- 01-25-2013, 03:23 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 1
- Rep Power
- 0
Converting a file from a directory into an MD5 hash
hi, i have some coding that converts a string to an MD5 hash:
import java.math.*;
import java.security.*;
public class MD5 {
public static void main(String args[]) throws Exception{
String s="md5 work";
MessageDigest m=MessageDigest.getInstance("MD5");
m.update(s.getBytes(),0,s.length());
System.out.println("MD5: "+new BigInteger(1,m.digest()).toString(16));
}
}
What i need is for this coding to be able to convert a file from my directory into an MD5 hash, is this possible/easy to do?
Similar Threads
-
Can someone explain hash table/hash function to me.... Thanks!
By kkmoslehpour in forum New To JavaReplies: 9Last Post: 11-12-2012, 11:38 AM -
problem reading converting file to hash map
By cataschok in forum New To JavaReplies: 2Last Post: 02-27-2012, 05:42 PM -
.jar file cannot find folders in the same directory as the .jar file
By ronald_mariah in forum NetBeansReplies: 1Last Post: 09-28-2011, 07:30 PM -
Read file from directory, update contents of the each file
By svpriyan in forum New To JavaReplies: 2Last Post: 05-11-2009, 10:07 AM -
[SOLVED] File chooser selecting file from directory...?
By prabhurangan in forum AWT / SwingReplies: 12Last Post: 06-18-2008, 04:08 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks