@Test public void testString() { MmoHash hash; hash = new MmoHash("11223344556677884AF7"); assertEquals("4161:8FC0:C83B:0E14:A589:954B:16E3:1466", hash.toString()); System.out.println(hash.toString()); hash = new MmoHash(new int[] { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x4A, 0xF7 }); assertEquals("4161:8FC0:C83B:0E14:A589:954B:16E3:1466", hash.toString()); System.out.println(hash.toString()); hash = new MmoHash("1122 3344 5566 7788 4AF7"); System.out.println(hash.toString()); assertEquals("4161:8FC0:C83B:0E14:A589:954B:16E3:1466", hash.toString()); hash = new MmoHash("1122:3344:5566:7788:4AF7"); System.out.println(hash.toString()); assertEquals("4161:8FC0:C83B:0E14:A589:954B:16E3:1466", hash.toString()); hash = new MmoHash("83FED3407A939738c552"); System.out.println(hash.toString()); assertEquals("A833:A774:34F3:BFBD:7A7A:B979:4214:9287", hash.toString()); hash = new MmoHash("83FE-D340-7A93-9738-C552"); System.out.println(hash.toString()); assertEquals("A833:A774:34F3:BFBD:7A7A:B979:4214:9287", hash.toString()); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); int cntDelim = 0; for (int cnt = 0; cnt < hash.length; cnt++) { int value = hash[cnt]; if (cntDelim++ == 2) { builder.append(':'); cntDelim = 1; } builder.append(String.format("%02X", (value & 0xFF))); } return builder.toString(); }
MmoHash { @Override public String toString() { StringBuilder builder = new StringBuilder(); int cntDelim = 0; for (int cnt = 0; cnt < hash.length; cnt++) { int value = hash[cnt]; if (cntDelim++ == 2) { builder.append(':'); cntDelim = 1; } builder.append(String.format("%02X", (value & 0xFF))); } return builder.toString(); } }
MmoHash { @Override public String toString() { StringBuilder builder = new StringBuilder(); int cntDelim = 0; for (int cnt = 0; cnt < hash.length; cnt++) { int value = hash[cnt]; if (cntDelim++ == 2) { builder.append(':'); cntDelim = 1; } builder.append(String.format("%02X", (value & 0xFF))); } return builder.toString(); } MmoHash(int[] input);  MmoHash(String input); }
MmoHash { @Override public String toString() { StringBuilder builder = new StringBuilder(); int cntDelim = 0; for (int cnt = 0; cnt < hash.length; cnt++) { int value = hash[cnt]; if (cntDelim++ == 2) { builder.append(':'); cntDelim = 1; } builder.append(String.format("%02X", (value & 0xFF))); } return builder.toString(); } MmoHash(int[] input);  MmoHash(String input); void updateHash(String input); void updateHash(int[] input); int[] getHash(); @Override String toString(); }
MmoHash { @Override public String toString() { StringBuilder builder = new StringBuilder(); int cntDelim = 0; for (int cnt = 0; cnt < hash.length; cnt++) { int value = hash[cnt]; if (cntDelim++ == 2) { builder.append(':'); cntDelim = 1; } builder.append(String.format("%02X", (value & 0xFF))); } return builder.toString(); } MmoHash(int[] input);  MmoHash(String input); void updateHash(String input); void updateHash(int[] input); int[] getHash(); @Override String toString();  }