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

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));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.