@Test(expected = IllegalArgumentException.class) public void testToScriptHashLargerThan25Chars() { AddressUtils.addressToScriptHash("AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8yyyy"); }
public static byte[] addressToScriptHash(String address) { if (!isValidAddress(address)) { throw new IllegalArgumentException("Not a valid NEO address."); } byte[] data = Base58.decode(address); byte[] buffer = new byte[20]; System.arraycopy(data, 1, buffer, 0, 20); return buffer; }
AddressUtils { public static byte[] addressToScriptHash(String address) { if (!isValidAddress(address)) { throw new IllegalArgumentException("Not a valid NEO address."); } byte[] data = Base58.decode(address); byte[] buffer = new byte[20]; System.arraycopy(data, 1, buffer, 0, 20); return buffer; } }
AddressUtils { public static byte[] addressToScriptHash(String address) { if (!isValidAddress(address)) { throw new IllegalArgumentException("Not a valid NEO address."); } byte[] data = Base58.decode(address); byte[] buffer = new byte[20]; System.arraycopy(data, 1, buffer, 0, 20); return buffer; }  }
AddressUtils { public static byte[] addressToScriptHash(String address) { if (!isValidAddress(address)) { throw new IllegalArgumentException("Not a valid NEO address."); } byte[] data = Base58.decode(address); byte[] buffer = new byte[20]; System.arraycopy(data, 1, buffer, 0, 20); return buffer; }  static boolean isValidAddress(String address); static byte[] addressToScriptHash(String address); static String scriptHashToAddress(byte[] scriptHash); }
AddressUtils { public static byte[] addressToScriptHash(String address) { if (!isValidAddress(address)) { throw new IllegalArgumentException("Not a valid NEO address."); } byte[] data = Base58.decode(address); byte[] buffer = new byte[20]; System.arraycopy(data, 1, buffer, 0, 20); return buffer; }  static boolean isValidAddress(String address); static byte[] addressToScriptHash(String address); static String scriptHashToAddress(byte[] scriptHash);  }