From a698eefa970540f0e8c55cbba1a58efbcd4b7148 Mon Sep 17 00:00:00 2001 From: Kacper Kruczek Date: Sun, 1 Jul 2018 15:17:50 +0200 Subject: [PATCH] 03 test flag --- 03-rozwiazanie.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/03-rozwiazanie.js b/03-rozwiazanie.js index be5bc10..26f800f 100644 --- a/03-rozwiazanie.js +++ b/03-rozwiazanie.js @@ -7,12 +7,12 @@ switch (flag) { break; case '-d': let fcs = JSON.parse(process.argv[4].replace(/'/g, '"')); - console.log(crc.decode(message, fcs)); break; case '-t': - - + let res = crc.encode(message); + console.log(res.encoded); + console.log(crc.decode(message, res.FCS)) break; default: throw "incorect flag"