03 test flag

This commit is contained in:
Kacper Kruczek 2018-07-01 15:17:50 +02:00
parent 8a28a2cfb1
commit a698eefa97

View File

@ -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"