From 1d05e40c0dfc79071cd2734e826f7ae5eb1ff9db Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 5 Jun 2021 16:36:40 +0200 Subject: [PATCH] Update base256.cpp --- base256.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base256.cpp b/base256.cpp index 1363a3f..bd82526 100644 --- a/base256.cpp +++ b/base256.cpp @@ -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;