Here you can find the source of SHA256(String text)
public static byte[] SHA256(String text) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] SHA256(String text) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(text.getBytes());/* w w w .ja v a 2 s.co m*/ return md.digest(); } }