Here you can find the source of getSHA256(String input)
public static String getSHA256(String input)
//package com.java2s; /*//from w w w .jav a 2 s. c o m * SigmaX 1.0.0b1 Source Code * Copyright (c) 2016 Curecoin Developers * Distributed under MIT License * Requires Apache Commons Library * Supports Java 1.7+ */ import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import javax.xml.bind.DatatypeConverter; public class Main { private static MessageDigest md; public static String getSHA256(String input) { try { return DatatypeConverter.printHexBinary(md.digest(input.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { System.err.println("[CRITICAL] UTF-8 ENCODING NOT SUPPORTED. EXITING."); System.exit(-1); return "ERROR"; // Make compiler happy. } } }