What development tests should I do when creating a Base58Checked parser?

1

1

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

goodguys_activate

Posted 2012-12-19T21:07:24.210

Reputation: 11 898

Question was closed 2013-03-19T20:59:12.583

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 2013-02-08T05:58:00.470

Answers

1

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.

goodguys_activate

Posted 2012-12-19T21:07:24.210

Reputation: 11 898