public static final byte[] digestBytes(byte[] data)
        throws RuntimeException {

        synchronized (MD5.class) {
            if (md5 == null) {
                try {
                    md5 = MessageDigest.getInstance("MD5");
                } catch (NoSuchAlgorithmException e) {
                    throw new RuntimeException(e.toString());
                }
            }

            return md5.digest(data);
        }
    }
public static final byte [ ] digestBytes ( byte [ ] data ) throws RuntimeException { synchronized ( MD5 . class ) { if ( md5 == null ) { try { md5 = MessageDigest . getInstance ( "MD5" ) ; } catch ( NoSuchAlgorithmException e ) { throw new RuntimeException ( e . toString ( ) ) ; } } return md5 . digest ( data ) ; } }
Retrieves a byte sequence representing the MD5 digest of the
specified byte sequence.

@param data the data to digest.
@return the MD5 digest as an array of 16 bytes.
@throws RuntimeException if an MD5 digest
algorithm is not available through the
java.security.MessageDigest spi