<p>I'm using BigInteger in .NET so these tests are unique to this scenario but may be adapted to Java or other languages.</p>

<p>The tests I've found helpful is when translating to or from hexadecimal at any intermediate step make sure the data is correct when:</p>

<ul>
<li>The first or last byte of the checksum is one or more 0's</li>
<li>The first or last byte of the address is one or more 0's</li>
</ul>

<p>Often times this may cause two's compliment errors depending on the implementation of BigInteger that is being used.  </p>

<p>I'll run my own version of vanity gen to generate addresses that have these errors and will post them here.</p>

CC BY-SA 3.0
2012-12-19T21:07:24.210Z
2012-12-19T21:07:24.210Z
makerofthings7
<p>Are there any special tests (test data) I should run against my code if I've written a Base58Checked encoder/decoder?</p>

CC BY-SA 3.0
2013-02-08T05:58:00.470Z
Hi makerofthings7, I think this question is on-topic, but you need to clarify what specifically the test data is supposed to do (validate your implementation?  performance test it?  etc.).  Otherwise there aren't any real concrete answers (what this site is designed for), only opinions (which this site is _not_ designed for).
eMansipater
<development><base58check>
What development tests should I do when creating a Base58Checked parser?
makerofthings7
# What development tests should I do when creating a Base58Checked parser?

(Asked by: username_0 on 2012-12-19)

Are there any special tests (test data) I should run against my code if I've written a Base58Checked encoder/decoder?

**Tags:** development, base58check

> **Comments:**
> **username_1**: Hi username_0, I think this question is on-topic, but you need to clarify what specifically the test data is supposed to do (validate your implementation?  performance test it?  etc.).  Otherwise there aren't any real concrete answers (what this site is designed for), only opinions (which this site is _not_ designed for).  

---

## 1 answers

### Answer by username_0 on 2012-12-19. Score: 1 | Accepted answer

I'm using BigInteger in .NET so these tests are unique to this scenario but may be adapted to Java or other languages.

The tests I've found helpful is when translating to or from hexadecimal at any intermediate step make sure the data is correct when:

* The first or last byte of the checksum is one or more 0's
* The first or last byte of the address is one or more 0's

Often times this may cause two's compliment errors depending on the implementation of BigInteger that is being used.

I'll run my own version of vanity gen to generate addresses that have these errors and will post them here.


---

