/** * Calculates the SHA-1 digest and returns the value as a hex string. * * @param data Data to digest * @return SHA-1 digest as a hex string * @throws IOException On error reading from the stream * @since 1.4 */ public static String shaHex(InputStream data) throws IOException { return Hex.encode(sha(data)); }
/** * Calculates the SHA-1 digest and returns the value as a hex string. * * @param data Data to digest * @return SHA-1 digest as a hex string */ public static String shaHex(byte[] data) { return Hex.encode(sha(data)); }
/** * Calculates the SHA-1 digest and returns the value as a hex string. * * @param data Data to digest * @return SHA-1 digest as a hex string */ public static String shaHex(String data) { return Hex.encode(sha(data)); }
/** * Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>. * * @param data Data to digest * @return SHA-1 digest */ public static byte[] sha(String data) { return sha(getBytesUtf8(data)); }