@Test public void scriptHashToAddressWithAddressVersion() { String script = "21030529d1296dc2af1f77d8344138a77748599b69599af7ae6be57812a4ec3fa33968747476aa"; byte[] scriptHash = Hash.sha256AndThenRipemd160(Numeric.hexStringToByteArray(script)); System.out.println(Numeric.toHexString(scriptHash)); String address = AddressUtils.scriptHashToAddress(scriptHash); String expectedAddress = "PRivaTenetyWuqK7Gj7Vd747d77ssYeDhL"; 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);  }