Hello,
I hope someone is more knowledgeable in Java than me while still knowing PHP!
The following Java code makes a hash from a string, and I need a PHP equivalent that makes the exact same hashes.
Simply md5() does not do the trick, and I looked at some PHP libraries for BigInteger but maybe it is over-kill to include all sorts of third party libraries?
public static String encrypt( String source ){
String md5=null;
try{
MessageDigest mdEnc = MessageDigest.getInstance("MD5"); // Encryption algorithm
mdEnc.update(source.getBytes(), 0, source.length());
md5 = new BigInteger(1, mdEnc.digest()).toString(16); // Encrypted string
}
catch(Exception ex){
return null;
}
return md5;
}
Thanks!