Java SHA256 SHA256byte(String input)

Here you can find the source of SHA256byte(String input)

Description

SH Abyte

License

Apache License

Declaration

private static byte[] SHA256byte(String input) 

Method Source Code


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

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Main {
    public final static String ALGORITHM_SHA256 = "SHA-256";

    private static byte[] SHA256byte(String input) {
        try {/*from ww  w . jav a 2 s.c  om*/
            MessageDigest md = MessageDigest.getInstance(ALGORITHM_SHA256);
            return md.digest(input.getBytes());
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. SHA256(String text)
  2. SHA256(String text)
  3. sha256(String text)
  4. SHA256(String texto)
  5. SHA256Binary(String toHash)
  6. sha256digest(@Nonnull byte[] data)
  7. sha256Digest(byte[] bytes)
  8. sha256Digest(final InputStream data)
  9. sha256Encode(String message)