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

<pre><code>System.out.println(javax.xml.bind.DatatypeConverter.printHexBinary(adshas160));
</code></pre>

CC BY-SA 3.0
2017-08-24T08:34:32.337Z
2017-08-24T08:34:32.337Z
alcio
<p>How to get hash160 address in string using bitcoinj ,I tried the following code</p>

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

<p>all I'm getting is [B@4c762604</p>

<hash><bitcoinj>
Getting Hash160 of bitcoin address
sano143
# Getting Hash160 of bitcoin address

(Asked by: username_0 on 2017-08-24)

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

**Tags:** hash, bitcoinj


---

## 1 answers

### Answer by username_1 on 2017-08-24. Score: 0 | Accepted answer

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

```


---

