@Test public void testEncodeHexString() { Assert.assertEquals("", MD5Utils.encodeHexString(new byte[0])); Assert.assertEquals("010203", MD5Utils.encodeHexString(new byte[] {1, 2, 3})); }
public static String encodeHexString(byte[] bytes) { int l = bytes.length; char[] out = new char[l << 1]; for (int i = 0, j = 0; i < l; i++) { out[j++] = DIGITS_LOWER[(0xF0 & bytes[i]) >>> 4]; out[j++] = DIGITS_LOWER[0x0F & bytes[i]]; } return new String(out); }
MD5Utils { public static String encodeHexString(byte[] bytes) { int l = bytes.length; char[] out = new char[l << 1]; for (int i = 0, j = 0; i < l; i++) { out[j++] = DIGITS_LOWER[(0xF0 & bytes[i]) >>> 4]; out[j++] = DIGITS_LOWER[0x0F & bytes[i]]; } return new String(out); } }
MD5Utils { public static String encodeHexString(byte[] bytes) { int l = bytes.length; char[] out = new char[l << 1]; for (int i = 0, j = 0; i < l; i++) { out[j++] = DIGITS_LOWER[(0xF0 & bytes[i]) >>> 4]; out[j++] = DIGITS_LOWER[0x0F & bytes[i]]; } return new String(out); }  }
MD5Utils { public static String encodeHexString(byte[] bytes) { int l = bytes.length; char[] out = new char[l << 1]; for (int i = 0, j = 0; i < l; i++) { out[j++] = DIGITS_LOWER[(0xF0 & bytes[i]) >>> 4]; out[j++] = DIGITS_LOWER[0x0F & bytes[i]]; } return new String(out); }  static String md5Hex(byte[] bytes); static String md5Hex(String value, String encode); static String encodeHexString(byte[] bytes); }
MD5Utils { public static String encodeHexString(byte[] bytes) { int l = bytes.length; char[] out = new char[l << 1]; for (int i = 0, j = 0; i < l; i++) { out[j++] = DIGITS_LOWER[(0xF0 & bytes[i]) >>> 4]; out[j++] = DIGITS_LOWER[0x0F & bytes[i]]; } return new String(out); }  static String md5Hex(byte[] bytes); static String md5Hex(String value, String encode); static String encodeHexString(byte[] bytes);  }