Skip to content

Commit 26a9dd2

Browse files
committed
Fix
1 parent 8d62a3f commit 26a9dd2

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/main/java/com/thealgorithms/ciphers/AtbashCipher.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* identically for both uppercase and lowercase letters.
66
* It's a symmetric cipher, meaning applying it twice returns the original text.
77
* Hence, the encrypting and the decrypting functions are identical
8-
*
98
* @author https://github.com/Krounosity
109
* Learn more: https://en.wikipedia.org/wiki/Atbash
1110
*/
@@ -55,15 +54,18 @@ public String convert() {
5554
for (char ch : toConvert.toCharArray()) {
5655

5756
// If the character is smallcased.
58-
if (isSmall(ch))
57+
if (isSmall(ch)) {
5958
convertedString.append((char) ('z' - (ch - 'a')));
59+
}
6060
// If the character is capital cased.
61-
else if (isCapital(ch))
61+
else if (isCapital(ch)) {
6262
convertedString.append((char) ('Z' - (ch - 'A')));
63+
}
6364
// Non-alphabetical character.
64-
else
65+
else {
6566
convertedString.append(ch);
67+
}
6668
}
6769
return convertedString.toString();
6870
}
69-
}
71+
}

src/test/java/com/thealgorithms/ciphers/AtbashTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public void atbashDecrypt() {
2727

2828
assertEquals(expectedText, encryptToNormal.getString());
2929
}
30-
}
30+
}

0 commit comments

Comments
 (0)