/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final byte[] data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final String data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @throws IOException * On error reading from the stream * @since 1.4 */ public static String sha512Hex(final InputStream data) throws IOException { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return SHA-512 digest * @since 1.4 */ public static byte[] sha512(final String data) { return sha512(StringUtils.getBytesUtf8(data)); }
/** * Calculates the SHA-512 digest and returns the value as a byte[]. * * @param input * the input * @return the SHA-512 digest */ public static final byte[] sha512(byte[] input) { return DigestUtils.sha512(input); }
/** * Calculates the SHA-512 digest and returns the value as a byte[]. * * @param input * the input * @return the SHA-512 digest */ public static final byte[] sha512(byte[] input) { return DigestUtils.sha512(input); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final String data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final byte[] data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final String data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final byte[] data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final byte[] data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @throws IOException * On error reading from the stream * @since 1.4 */ public static String sha512Hex(final InputStream data) throws IOException { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final String data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final String data) { return Hex.encodeHexString(sha512(data)); }
/** * Calculates the SHA-512 digest and returns the value as a hex string. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest * @return SHA-512 digest as a hex string * @since 1.4 */ public static String sha512Hex(final byte[] data) { return Hex.encodeHexString(sha512(data)); }
@Override public String encrypt(String unencryptedPassword) { byte[] bytes = unencryptedPassword.getBytes(); // for compatibility with OSUser - use platform encoding byte[] hash = sha512(bytes); return new String(encodeBase64(hash)); // for compatibility with OSUser - use platform encoding }
/** * Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return SHA-512 digest * @since 1.4 */ public static byte[] sha512(final String data) { return sha512(StringUtils.getBytesUtf8(data)); }
/** * Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return SHA-512 digest * @since 1.4 */ public static byte[] sha512(final String data) { return sha512(StringUtils.getBytesUtf8(data)); }
/** * Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return SHA-512 digest * @since 1.4 */ public static byte[] sha512(final String data) { return sha512(StringUtils.getBytesUtf8(data)); }
/** * Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>. * <p> * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. * </p> * * @param data * Data to digest; converted to bytes using {@link StringUtils#getBytesUtf8(String)} * @return SHA-512 digest * @since 1.4 */ public static byte[] sha512(final String data) { return sha512(StringUtils.getBytesUtf8(data)); }