Package net.sf.basedb.util
Class MD5
java.lang.Object
net.sf.basedb.util.MD5
This class calculates the MD5 hash of a string and
returns it represented as a hexadecimal string.
- Version:
- 2.0
- Author:
- Nicklas
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getHashString
(String in) Calculates the MD5 hash of an UTF-8 encoded string.static String
static String
If the string is shorter than the specified length, it is left padded with the specified character.static MessageDigest
-
Constructor Details
-
MD5
public MD5()
-
-
Method Details
-
getHashString
Calculates the MD5 hash of an UTF-8 encoded string. -
newInstance
-
getHashString
-
leftPad
If the string is shorter than the specified length, it is left padded with the specified character. If the string is null or longer than the specified length it is returned unchanged.- Parameters:
toPad
- The string to padc
- The character to pad withlength
- The length of the resulting string- Returns:
- The left-padded string
-