Java SHA512 sha512hash_base64(final String toHash)

Here you can find the source of sha512hash_base64(final String toHash)

Description

shahasbase

License

Apache License

Declaration

@Deprecated
    public static String sha512hash_base64(final String toHash) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;

public class Main {
    @Deprecated
    public static String sha512hash_base64(final String toHash) {
        final MessageDigest md;
        try {/*from w ww .  j  a  va2s.c o  m*/
            md = MessageDigest.getInstance("SHA-512");
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException("Shouldn't happen");
        }
        final byte[] digest = md.digest(toHash.getBytes());
        return new String(Base64.getEncoder().encode(digest));
    }
}

Related

  1. sha512(String input)
  2. SHA512(String original)
  3. sha512(String string)
  4. sha512(String string)
  5. sha512AsBytes(byte[] input)
  6. sha512String(String base)