MD5 / SHA1 Hashes erzeugen mit JAVA

   public static String getMD5Hash(String in) {
        StringBuffer result = new StringBuffer(32);
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            md5.update(in.getBytes());
            Formatter f = new Formatter(result);
            for (byte b : md5.digest()) {
                f.format("%02x", b);
            }
        } catch (NoSuchAlgorithmException ex) {
            ex.printStackTrace();
        }
        return result.toString();
    }

Subscribe to comments Comment | Trackback |
Post Tags:

Browse Timeline


Comments ( Be the First )

Great site and useful content! Could you leave some opinion about my sites?
My pages
[url=http://ownsite.com/b/]My pages[/url]
http://ownsite.com/p/ My pages

John added these pithy words on May 31 08 at 3:49 am

Add a Comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>