Java SHA512 sha512String(String base)

Here you can find the source of sha512String(String base)

Description

sha String

License

Open Source License

Declaration

public static byte[] sha512String(String base) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.security.MessageDigest;

public class Main {
    public static byte[] sha512String(String base) {
        try {//from   w ww  .ja  v a2  s.c  o m
            MessageDigest digest = MessageDigest.getInstance("SHA-512");
            byte[] enc = base.getBytes("UTF-8");
            byte[] hash = digest.digest(enc);

            return hash;
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
}

Related

  1. SHA512(String original)
  2. sha512(String string)
  3. sha512(String string)
  4. sha512AsBytes(byte[] input)
  5. sha512hash_base64(final String toHash)