![JAR search and dependency download from the Maven repository](/logo.png)
com.tukeof.common.util.SignatureUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-core Show documentation
Show all versions of common-core Show documentation
a common and useful pure java library
The newest version!
package com.tukeof.common.util;
import com.tukeof.common.crypto.MessageDigestEnum;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
/**
* Create by tuke on 2019-02-19
*/
public class SignatureUtil {
public static String md5(String input) {
return md5(input.getBytes());
}
/**
* @param input bytes
* @return ascii string
*/
public static String md5(byte[] input) {
try {
byte[] output = MessageDigestEnum.MD5.digest(input);
return new String(output, StandardCharsets.US_ASCII);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy