Java tutorial
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] encryptSHA512(byte[] data) { return hashTemplate(data, "SHA512"); } private static byte[] hashTemplate(byte[] data, String algorithm) { if (data == null || data.length <= 0) return null; try { MessageDigest md = MessageDigest.getInstance(algorithm); md.update(data); return md.digest(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); return null; } } }