Top Description Fields Constructors Methods
liquibase.util

public Class MD5Util

extends Object
Class Inheritance
Imports
liquibase.Scope, .GlobalConfiguration, liquibase.exception.UnexpectedLiquibaseException, java.io.InputStream, java.security.DigestInputStream, .MessageDigest

Generates md5-sums based on a string.

Field Summary

Modifier and TypeField and Description
private static final char[]
DIGITS_LOWER

Used to build output as Hex

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String
public static String
private static char[]

Returns:

A char[] containing hexadecimal characters
encodeHex
(byte[]
a byte[] to convert to Hex characters
data
)

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DIGITS_LOWERback to summary
private static final char[] DIGITS_LOWER

Used to build output as Hex

Constructor Detail

MD5Utilback to summary
public MD5Util()

Method Detail

computeMD5back to summary
public static String computeMD5(String input)
computeMD5back to summary
public static String computeMD5(InputStream stream)
encodeHexback to summary
private static char[] encodeHex(byte[] data)

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order. The returned array will be double the length of the passed array, as it takes two characters to represent any given byte.

Parameters
data:byte[]

a byte[] to convert to Hex characters

Returns:char[]

A char[] containing hexadecimal characters