Skip to content

Commit

Permalink
Update base256.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
fleschutz authored Jun 5, 2021
1 parent e786804 commit 1d05e40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ int main(int argc, char *argv[])
uint8_t binaryData[128 / 8] = {};
randomize(binaryData, sizeof(binaryData));

// encode:
string text = encodeB256U(binaryData, sizeof(binaryData));
cout << "pseudorandom 128 bits encoded in B256U are <" << text;

// decode:
uint8_t decodedData[sizeof(binaryData)] = {};
decodeB256U(text, decodedData);

// check:
if (memcmp(binaryData, decodedData, sizeof(binaryData)) == 0)
cout << "> and decoding works!" << endl;
return 0;
Expand Down

0 comments on commit 1d05e40

Please sign in to comment.