-//
-// @Test
-// public void aaf_941() throws Exception {
-// // User notes: From reported error "aaf" not coded right
-//
-//
-// }
+
+ @Test
+ public void aaf_941() throws Exception {
+ // User notes: From reported error "aaf" not coded right for odd digits
+ // Note: In the original concept, this isn't a valid Hex digit. It has to do with whether to assume an initial
+ // char of "0" if left out.
+
+ String sample = "aaf";
+ byte[] bytes = Hash.fromHexNo0x(sample);
+ String back = Hash.toHexNo0x(bytes);
+ // Note: We don't presume to know that someone left off leading 0 on start.
+ assertEquals("0aaf", back);
+
+ sample = "0x0aaf";
+ bytes = Hash.fromHex(sample);
+ back = Hash.toHex(bytes);
+ assertEquals(sample, back);
+
+ // Assumed leading zero. Note, we ALWAYS translate back with leading zero.
+ bytes = Hash.fromHex("0xaaf");
+ back = Hash.toHex(bytes);
+ assertEquals(sample, back);
+
+ }