Here you can find the source of sha512AsBytes(byte[] input)
Parameter | Description |
---|---|
input | Input as bytes. |
public static byte[] sha512AsBytes(byte[] input)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { /**/* ww w .ja v a2 s . com*/ * Generate SHA-512 as bytes. * * @param input Input as bytes. * @return SHA bytes. */ public static byte[] sha512AsBytes(byte[] input) { MessageDigest md = null; try { md = MessageDigest.getInstance("SHA-512"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } md.update(input); return md.digest(); } }