/** * A helper method to calculate SHA-512 hashes. Please note that a new {@link MessageDigest} object is created at * each call (to ensure thread safety), so you shouldn't use this if you need to do many hash calculations in * success on the same thread. * * @param data to get hashed * @return SHA-512 hash of data */ public static byte[] sha512(byte[]... data) { return hash("SHA-512", data); }
/** * A helper method to calculate SHA-1 hashes. Supplying multiple byte arrays has the same result as a * concatenation of all arrays, but might perform better. * <p> * Please note that a new {@link MessageDigest} object is created at * each call (to ensure thread safety), so you shouldn't use this if you need to do many hash calculations in short * order on the same thread. * </p> * * @param data to get hashed * @return SHA hash of data */ public static byte[] sha1(byte[]... data) { return hash("SHA-1", data); }
/** * A helper method to calculate RIPEMD-160 hashes. Supplying multiple byte arrays has the same result as a * concatenation of all arrays, but might perform better. * <p> * Please note that a new {@link MessageDigest} object is created at * each call (to ensure thread safety), so you shouldn't use this if you need to do many hash calculations in short * order on the same thread. * </p> * * @param data to get hashed * @return RIPEMD-160 hash of data */ public static byte[] ripemd160(byte[]... data) { return hash("RIPEMD160", data); }