All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hu.blackbelt.epsilon.runtime.utils.MD5Utils Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package hu.blackbelt.epsilon.runtime.utils;


public class MD5Utils {
    public static String md5(String md5) {
       try {
            java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
            byte[] array = md.digest(md5.getBytes());
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < array.length; ++i) {
              sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3));
           }
            return sb.toString();
        } catch (java.security.NoSuchAlgorithmException e) {
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy