Skip to content

Commit

Permalink
change the output of the result to the console
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeiown committed Jul 2, 2024
1 parent d039472 commit 11d90b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions base64FromFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ function processText() {
rl.on('line', (text) => {
const result = isBase64(text) ? decodeText(text) : Buffer.from(text, 'utf8').toString('base64');

console.log(isBase64(text) ? 'Decrypted text:' : 'Encrypted text:', `${result}`);
writeToOutputFile(`${result}${os.EOL}`);
console.log(isBase64(text) ? `${os.EOL}Decrypted text:${os.EOL}` : `${os.EOL}Encrypted text:${os.EOL}`, result);
writeToOutputFile(result);
});

rl.on('close', () => {
console.log('File processing complete.');
console.log(`${os.EOL}File processing complete.`);
});
}

Expand Down
4 changes: 2 additions & 2 deletions xorFromFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function processText() {
const isEncoded = isXOREncoded(text);
const result = isEncoded ? decodeText(text, encryptionKey) : encodeText(text, encryptionKey);

console.log(isEncoded ? 'Decrypted text:' : 'Encrypted text:', result);
writeToOutputFile(`${result}${os.EOL}`);
console.log(result);
writeToOutputFile(result);
});

rl.on('close', () => {
Expand Down

0 comments on commit 11d90b5

Please sign in to comment.