Here you can find the source of SHA512(String original)
public static String SHA512(String original)
//package com.java2s; //License from project: Open Source License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String SHA512(String original) { String sha512 = ""; try {//from w w w .ja va 2 s .c o m final MessageDigest md = MessageDigest.getInstance("SHA-512"); md.update(original.getBytes()); final byte[] digest = md.digest(); final StringBuilder sb = new StringBuilder(); for (byte b : digest) { sb.append(String.format("%02x", b & 0xff)); } sha512 = sb.toString(); } catch (NoSuchAlgorithmException ignored) { } return sha512; } }