Package com.nexmo.client.auth
Class MD5Util
- java.lang.Object
-
- com.nexmo.client.auth.MD5Util
-
public class MD5Util extends java.lang.Object
Contains utility methods that use MD5 hashing. The class uses STANDARD JVM MD5 algorithm.
-
-
Constructor Summary
Constructors Constructor Description MD5Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
calculateMd5(java.lang.String input)
Calculates MD5 hash for string.static java.lang.String
calculateMd5(java.lang.String input, java.lang.String encoding)
Calculates MD5 hash for string.
-
-
-
Constructor Detail
-
MD5Util
public MD5Util()
-
-
Method Detail
-
calculateMd5
public static java.lang.String calculateMd5(java.lang.String input) throws java.security.NoSuchAlgorithmException
Calculates MD5 hash for string. assume string is UTF-8 encoded- Parameters:
input
- string which is going to be encoded into MD5 format- Returns:
- MD5 representation of the input string
- Throws:
java.security.NoSuchAlgorithmException
- if the MD5 algorithm is not available.
-
calculateMd5
public static java.lang.String calculateMd5(java.lang.String input, java.lang.String encoding) throws java.security.NoSuchAlgorithmException, java.io.UnsupportedEncodingException
Calculates MD5 hash for string.- Parameters:
input
- string which is going to be encoded into MD5 formatencoding
- character encoding of the string which is going to be encoded into MD5 format- Returns:
- MD5 representation of the input string
- Throws:
java.security.NoSuchAlgorithmException
- if the MD5 algorithm is not available.java.io.UnsupportedEncodingException
- if the specified encoding is unavailable.
-
-