Here you can find the source of SHA256byte(String input)
private static byte[] SHA256byte(String input)
//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); } } }