@Test public void testIsValidAddress() { assertTrue(isValidAddress(SampleKeys.ADDRESS)); assertTrue(isValidAddress(SampleKeys.ADDRESS_NO_PREFIX)); assertFalse(isValidAddress("")); assertFalse(isValidAddress(SampleKeys.ADDRESS + 'a')); assertFalse(isValidAddress(SampleKeys.ADDRESS.substring(1))); }
public static boolean isValidAddress(String input) { String cleanInput = Numeric.cleanHexPrefix(input); try { Numeric.toBigIntNoPrefix(cleanInput); } catch (NumberFormatException e) { return false; } return cleanInput.length() == Keys.ADDRESS_LENGTH_IN_HEX; }
WalletUtils { public static boolean isValidAddress(String input) { String cleanInput = Numeric.cleanHexPrefix(input); try { Numeric.toBigIntNoPrefix(cleanInput); } catch (NumberFormatException e) { return false; } return cleanInput.length() == Keys.ADDRESS_LENGTH_IN_HEX; } }
WalletUtils { public static boolean isValidAddress(String input) { String cleanInput = Numeric.cleanHexPrefix(input); try { Numeric.toBigIntNoPrefix(cleanInput); } catch (NumberFormatException e) { return false; } return cleanInput.length() == Keys.ADDRESS_LENGTH_IN_HEX; }  }
WalletUtils { public static boolean isValidAddress(String input) { String cleanInput = Numeric.cleanHexPrefix(input); try { Numeric.toBigIntNoPrefix(cleanInput); } catch (NumberFormatException e) { return false; } return cleanInput.length() == Keys.ADDRESS_LENGTH_IN_HEX; }  static String generateFullNewWalletFile(String password, File destinationDirectory); static String generateLightNewWalletFile(String password, File destinationDirectory); static String generateNewWalletFile(
            String password, File destinationDirectory, boolean useFullScrypt); static String generateWalletFile(
            String password, ECKeyPair ecKeyPair, File destinationDirectory, boolean useFullScrypt); static Credentials loadCredentials(String password, String source); static Credentials loadCredentials(String password, File source); static String getDefaultKeyDirectory(); static String getTestnetKeyDirectory(); static String getMainnetKeyDirectory(); static boolean isValidPrivateKey(String privateKey); static boolean isValidAddress(String input); }
WalletUtils { public static boolean isValidAddress(String input) { String cleanInput = Numeric.cleanHexPrefix(input); try { Numeric.toBigIntNoPrefix(cleanInput); } catch (NumberFormatException e) { return false; } return cleanInput.length() == Keys.ADDRESS_LENGTH_IN_HEX; }  static String generateFullNewWalletFile(String password, File destinationDirectory); static String generateLightNewWalletFile(String password, File destinationDirectory); static String generateNewWalletFile(
            String password, File destinationDirectory, boolean useFullScrypt); static String generateWalletFile(
            String password, ECKeyPair ecKeyPair, File destinationDirectory, boolean useFullScrypt); static Credentials loadCredentials(String password, String source); static Credentials loadCredentials(String password, File source); static String getDefaultKeyDirectory(); static String getTestnetKeyDirectory(); static String getMainnetKeyDirectory(); static boolean isValidPrivateKey(String privateKey); static boolean isValidAddress(String input);  }