public static String SHA(String password) throws Exception {

        MessageDigest md = MessageDigest.getInstance("SHA-256");
        System.out.println(md.digest());
        md.update(password.getBytes());

        byte byteData[] = md.digest();

        System.out.println(md.digest());
        //convert the byte to hex format method 1
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < byteData.length; i++) {
            sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
        }

        return sb.toString();

    }