/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final byte[] data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final String data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @throws IOException * On error reading from the stream * @since 1.7 */ public static String md2Hex(final InputStream data) throws IOException { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return MD2 digest * @since 1.7 */ public static byte[] md2(final String data) { return md2(StringUtils.getBytesUtf8(data)); }
/** * An MD2 hash should always be a 16 element byte[]. */ @Test public void testMd2Length() { String hashMe = "this is some string that is longer than 16 characters"; byte[] hash = DigestUtils.md2(getBytesUtf8(hashMe)); assertEquals(16, hash.length); hashMe = "length < 16"; hash = DigestUtils.md2(getBytesUtf8(hashMe)); assertEquals(16, hash.length); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final String data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final byte[] data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final String data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final byte[] data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final String data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final byte[] data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final String data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @throws IOException * On error reading from the stream * @since 1.7 */ public static String md2Hex(final InputStream data) throws IOException { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final byte[] data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 32 character hex string. * * @param data * Data to digest * @return MD2 digest as a hex string * @since 1.7 */ public static String md2Hex(final String data) { return Hex.encodeHexString(md2(data)); }
/** * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return MD2 digest * @since 1.7 */ public static byte[] md2(final String data) { return md2(StringUtils.getBytesUtf8(data)); }
/** * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return MD2 digest * @since 1.7 */ public static byte[] md2(final String data) { return md2(StringUtils.getBytesUtf8(data)); }
/** * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return MD2 digest * @since 1.7 */ public static byte[] md2(final String data) { return md2(StringUtils.getBytesUtf8(data)); }
/** * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return MD2 digest * @since 1.7 */ public static byte[] md2(final String data) { return md2(StringUtils.getBytesUtf8(data)); }
/** * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return MD2 digest * @since 1.7 */ public static byte[] md2(final String data) { return md2(StringUtils.getBytesUtf8(data)); }