src/main/java/com/leacox/pusher/Pusher.java
/**
     * Returns a md5 representation of the given string
     */
Returns a md5 representation of the given string
Returns a md5 representation of the given string
private static String md5Representation(String data) {
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            byte[] digest = messageDigest.digest(data.getBytes("UTF-8"));
            return byteArrayToString(digest);
        } catch (NoSuchAlgorithmException nsae) {
            throw new RuntimeException("No MD5 algorithm");
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("No UTF-8");
        }
    }
private static String md5Representation ( String data ) { try { MessageDigest messageDigest = MessageDigest . getInstance ( "MD5" ) ; byte [ ] digest = messageDigest . digest ( data . getBytes ( "UTF-8" ) ) ; return byteArrayToString ( digest ) ; } catch ( NoSuchAlgorithmException nsae ) { throw new RuntimeException ( "No MD5 algorithm" ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( "No UTF-8" ) ; } }
Returns a md5 representation of the given string
Returns a md5 representation of the given string
// Get MD5 MessageDigest // We should never come here, because GAE has a MD5 algorithm // We should never come here, because UTF-8 should be available