import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; class Program01 { public static String digest(String clearText) { String digestText = null; try { digestText = tryDigest(clearText); }catch(NoSuchAlgorithmException ex) { System.err.println("Nincs ilyen algoritmus"); } return digestText; } public static String tryDigest(String clearText) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA1"); byte[] sb = md.digest(clearText.getBytes()); StringBuffer hexText = new StringBuffer(); for (int i=0; i