How to generate an MD5 checksum for a file in Android?
问题 In my app I have a requirement to generate an MD5 checksum for a file. Could you please tell me if there is any way in which this can be achieved? Thank you. 回答1: Convert the file content into string & use the below method: public static String getMD5EncryptedString(String encTarget){ MessageDigest mdEnc = null; try { mdEnc = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { System.out.println("Exception while encrypting to md5"); e.printStackTrace(); } // Encryption