src/main/java/org/wymiwyg/commons/util/MD5.java
public static String dumpBytes(byte[] bytes) {
		int i;
		StringBuffer sb = new StringBuffer();
		for (i=0; i<bytes.length; i++) {
			if (i%32 == 0 && i!=0) {
				sb.append("\n");
			}
			String s = Integer.toHexString(bytes[i]);
			if (s.length() < 2) {
				s = "0"+s;
			}
			if (s.length() > 2) {
				s = s.substring(s.length()-2);
			}
			sb.append(s);
		}
		return sb.toString();
	}
public static String dumpBytes(byte[] bytes) {
		int i;
		StringBuffer sb = new StringBuffer();
		for (i=0; i<bytes.length; i++) {
			if (i%32 == 0 && i!=0) {
				sb.append("\n");
			}
			String s = Integer.toHexString(bytes[i]);
			if (s.length() < 2) {
				s = "0"+s;
			}
			if (s.length() > 2) {
				s = s.substring(s.length()-2);
			}
			sb.append(s);
		}
		return sb.toString();
	}
public static String dumpBytes ( byte [ ] bytes ) { int i ; StringBuffer sb = new StringBuffer ( ) ; for ( i = 0 ; i < bytes . length ; i ++ ) { if ( i % 32 == 0 && i != 0 ) { sb . append ( "\n" ) ; } String s = Integer . toHexString ( bytes [ i ] ) ; if ( s . length ( ) < 2 ) { s = "0" + s ; } if ( s . length ( ) > 2 ) { s = s . substring ( s . length ( ) - 2 ) ; } sb . append ( s ) ; } return sb . toString ( ) ; }
/*
private void debugStatus(String m) {
System.out.println(m+":");
System.out.println("in: "+dumpBytes(in));
System.out.println("bits: "+bits);
System.out.println("buf: "
+Integer.toHexString(buf[0])+" "
+Integer.toHexString(buf[1])+" "
+Integer.toHexString(buf[2])+" "
+Integer.toHexString(buf[3]));
}
/ * private void debugStatus ( String m ) { System . out . println ( m + : ) ; System . out . println ( in : + dumpBytes ( in )) ; System . out . println ( bits : + bits ) ; System . out . println ( buf : + Integer . toHexString ( buf [ 0 ] ) + + Integer . toHexString ( buf [ 1 ] ) + + Integer . toHexString ( buf [ 2 ] ) + + Integer . toHexString ( buf [ 3 ] )) ; }