Getting Hash160 of bitcoin address

0

How to get hash160 address in string using bitcoinj ,I tried the following code

NetworkParameters params = TestNet3Params.get();
String ads = "n1XZMMm3ikh97Mr8JVnnahfugad2DRcVrB";
Address address = new Address(params, ads);
byte[] adshas160 = address.getHash160();
System.out.println(adshas160);

all I'm getting is [B@4c762604

sano143

Posted 2017-08-24T06:41:32.277

Reputation: 33

Answers

0

To get the hash in a human readable version, I advice you to use a class that'll do it for you:

System.out.println(javax.xml.bind.DatatypeConverter.printHexBinary(adshas160));

alcio

Posted 2017-08-24T06:41:32.277

Reputation: 1 164