@Test public void scriptHashToAddress() { NeoConfig.setAddressVersion((byte) 0x17); String script = "2102208aea0068c429a03316e37be0e3e8e21e6cda5442df4c5914a19b3a9b6de37568747476aa"; byte[] scriptHash = Hash.sha256AndThenRipemd160(Numeric.hexStringToByteArray(script)); String address = AddressUtils.scriptHashToAddress(scriptHash); String expectedAddress = "Aa63RMYRWHPRcrZNzUnq5SNrPqoV866Spu"; assertThat(address, is(expectedAddress)); }
public static String scriptHashToAddress(byte[] scriptHash) { byte[] script = ArrayUtils.concatenate(NeoConfig.addressVersion(), scriptHash); byte[] checksum = ArrayUtils.getFirstNBytes(hash256(script), 4); return Base58.encode(ArrayUtils.concatenate(script, checksum)); }
AddressUtils { public static String scriptHashToAddress(byte[] scriptHash) { byte[] script = ArrayUtils.concatenate(NeoConfig.addressVersion(), scriptHash); byte[] checksum = ArrayUtils.getFirstNBytes(hash256(script), 4); return Base58.encode(ArrayUtils.concatenate(script, checksum)); } }
AddressUtils { public static String scriptHashToAddress(byte[] scriptHash) { byte[] script = ArrayUtils.concatenate(NeoConfig.addressVersion(), scriptHash); byte[] checksum = ArrayUtils.getFirstNBytes(hash256(script), 4); return Base58.encode(ArrayUtils.concatenate(script, checksum)); }  }
AddressUtils { public static String scriptHashToAddress(byte[] scriptHash) { byte[] script = ArrayUtils.concatenate(NeoConfig.addressVersion(), scriptHash); byte[] checksum = ArrayUtils.getFirstNBytes(hash256(script), 4); return Base58.encode(ArrayUtils.concatenate(script, checksum)); }  static boolean isValidAddress(String address); static byte[] addressToScriptHash(String address); static String scriptHashToAddress(byte[] scriptHash); }
AddressUtils { public static String scriptHashToAddress(byte[] scriptHash) { byte[] script = ArrayUtils.concatenate(NeoConfig.addressVersion(), scriptHash); byte[] checksum = ArrayUtils.getFirstNBytes(hash256(script), 4); return Base58.encode(ArrayUtils.concatenate(script, checksum)); }  static boolean isValidAddress(String address); static byte[] addressToScriptHash(String address); static String scriptHashToAddress(byte[] scriptHash);  }