Reworked encryption #8

Merged
2tefan merged 8 commits from rework into main 1 year ago
lumi200 commented 1 year ago
Owner
There is no content yet.
lumi200 added 4 commits 1 year ago
lumi200 requested review from 2tefan 1 year ago
2tefan requested changes 1 year ago
2tefan left a comment
Owner

See comments

See comments
arRaw = arRaw.replaceAll("[- ]", "");
if (encrypt) {
System.out.println("Chiffrentext:");
ct = et.encrypt(zwtRaw, arRaw);
Owner

Shouldn't we put this in its own methode?

Like:

public static void main() {
	Mode m = CLI.encryptOrDecrypt();
	String input = CLI.read();
	...
    
	// Instead of the if
	Tapir.convert(m, input);
	...
}
Shouldn't we put this in its own methode? Like: ``` public static void main() { Mode m = CLI.encryptOrDecrypt(); String input = CLI.read(); ... // Instead of the if Tapir.convert(m, input); ... } ```
lumi200 marked this conversation as resolved
package at.lumi200.sleeperagent.helper;
public class EncryptionTool {
Owner

Should't we use static Methods/Classes instead of an empty constructor? Or is there any advantage in using this?

Should't we use static Methods/Classes instead of an empty constructor? Or is there any advantage in using this?
lumi200 marked this conversation as resolved
public String encrypt(String zwt, String ar) {
StringBuilder output = new StringBuilder();
for (int i = 0; i < zwt.length(); i++) {
output.append((Integer.parseInt(String.valueOf(zwt.charAt(i))) + Integer.parseInt(String.valueOf(ar.charAt(i)))) % 10);
Owner

Maybe put Integer.parseInt(String.valueOf(zwt.charAt(i)) in a methode to clean up this line

Maybe put `Integer.parseInt(String.valueOf(zwt.charAt(i))` in a methode to clean up this line
lumi200 marked this conversation as resolved
lumi200 added 1 commit 1 year ago
lumi200 added 1 commit 1 year ago
lumi200 added 1 commit 1 year ago
lumi200 added 1 commit 1 year ago
lumi200 requested review from 2tefan 1 year ago
2tefan reviewed 1 year ago
AR 78356 37723
OUT 80691 91297
*/
Assertions.assertEquals("8069191297", EncryptionTool.convert(OperationMode.ENCRYPT, "1234564574", "7835637723"));
Owner

Nice 🎉

Nice 🎉
2tefan merged commit d09d2225c5 into main 1 year ago
lumi200 deleted branch rework 1 year ago

Reviewers

2tefan was requested for review 1 year ago
The pull request has been merged as d09d2225c5.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: Schober/SleeperAgent#8
Loading…
There is no content yet.