Close
Chibi said:
convert them to md5.ext ?! whats that ?
you got a pic with the name
"Haruhi swimsuits 01.jpg"
and it becomes
"d70733f77acd1d3493e25a47c251e509.jpg"

@van
imho its just the binary data, the code i use for java looks like :

public static String getMD5Checksum(String filename) throws Exception {
byte[] b = createChecksum(filename);
String result = "";
for (int i=0; i < b.length; i++) {
result +=
Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );
}
return result;
}

public static byte[] createChecksum(String filename) throws Exception{
InputStream fis = new FileInputStream(filename);

byte[] buffer = new byte[1024];
MessageDigest complete = MessageDigest.getInstance("MD5");
int numRead;
do {
numRead = fis.read(buffer);
if (numRead > 0) {
complete.update(buffer, 0, numRead);
}
}
while (numRead != -1);
fis.close();
return complete.digest();
}

so just using getMD5Checksum("c:\test.jpg"); will get me the md5 of the file...