Java SHA256 sha256(String Input)

Here you can find the source of sha256(String Input)

Description

sha

License

Open Source License

Declaration

public static String sha256(String Input) throws java.security.NoSuchAlgorithmException 

Method Source Code


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

import java.math.BigInteger;
import java.security.MessageDigest;

public class Main {
    public static String sha256(String Input) throws java.security.NoSuchAlgorithmException {
        String Return = Input;/*  w w  w . j av a 2  s. c  o m*/
        MessageDigest MessageD = MessageDigest.getInstance("SHA-256");
        MessageD.update(Return.getBytes(), 0, Return.length());
        return new BigInteger(1, MessageD.digest()).toString(16);
    }
}

Related

  1. sha256(final String string)
  2. sha256(InputStream data)
  3. sha256(String base)
  4. sha256(String base)
  5. sha256(String data)
  6. SHA256(String input)
  7. sha256(String message)
  8. sha256(String password, String salt)
  9. sha256(String plainText)