public static byte[] sha256(byte[] data){
  try {
    MessageDigest a=MessageDigest.getInstance("SHA-256");
    return a.digest(data);
  }
 catch (  NoSuchAlgorithmException e) {
    throw new RuntimeException(e);
  }
}

public static byte [ ] sha256 ( byte [ ] data ) { try { MessageDigest a = MessageDigest . getInstance ( "SHA-256" ) ; return a . digest ( data ) ; } catch ( NoSuchAlgorithmException e ) { throw new RuntimeException ( e ) ; } }
return sha256 hash of data
