@Test public void testNormalise() { assertThat(normalise("foo"), is("foo")); assertThat(normalise("foo.bar.baz.eth"), is("foo.bar.baz.eth")); assertThat(normalise("fOo.eth"), is("foo.eth")); assertThat(normalise("foo-bar.eth"), is("foo-bar.eth")); }
static String normalise(String ensName) { try { return IDN.toASCII(ensName, IDN.USE_STD3_ASCII_RULES) .toLowerCase(); } catch (IllegalArgumentException e) { throw new EnsResolutionException("Invalid ENS name provided: " + ensName); } }
NameHash { static String normalise(String ensName) { try { return IDN.toASCII(ensName, IDN.USE_STD3_ASCII_RULES) .toLowerCase(); } catch (IllegalArgumentException e) { throw new EnsResolutionException("Invalid ENS name provided: " + ensName); } } }
NameHash { static String normalise(String ensName) { try { return IDN.toASCII(ensName, IDN.USE_STD3_ASCII_RULES) .toLowerCase(); } catch (IllegalArgumentException e) { throw new EnsResolutionException("Invalid ENS name provided: " + ensName); } }  }
NameHash { static String normalise(String ensName) { try { return IDN.toASCII(ensName, IDN.USE_STD3_ASCII_RULES) .toLowerCase(); } catch (IllegalArgumentException e) { throw new EnsResolutionException("Invalid ENS name provided: " + ensName); } }  static byte[] nameHashAsBytes(String ensName); static String nameHash(String ensName); }
NameHash { static String normalise(String ensName) { try { return IDN.toASCII(ensName, IDN.USE_STD3_ASCII_RULES) .toLowerCase(); } catch (IllegalArgumentException e) { throw new EnsResolutionException("Invalid ENS name provided: " + ensName); } }  static byte[] nameHashAsBytes(String ensName); static String nameHash(String ensName);  }