Skip to content

Commit 7223380

Browse files
authored
Update MonoAlphabetic.java
1 parent 3e9faea commit 7223380

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static String encrypt(String data, String key) {
4141
char c;
4242
StringBuffer sb = new StringBuffer(data);
4343

44-
for(int i=0; i<sb.length(); i++) {
44+
for(int i = 0; i < sb.length(); i++) {
4545
idx = sb.charAt(i) - 65;
4646
c = key.charAt(idx);
4747
sb.setCharAt(i, c);
@@ -54,7 +54,7 @@ public static String decrypt(String data, String key) {
5454
char c;
5555
StringBuffer sb = new StringBuffer(data);
5656

57-
for(int i=0; i<sb.length(); i++) {
57+
for(int i = 0; i < sb.length(); i++) {
5858
c = sb.charAt(i);
5959
idx = getIndex(c, key);
6060
c = (char) (idx + 65);
@@ -65,7 +65,7 @@ public static String decrypt(String data, String key) {
6565

6666
public static int getIndex(char c, String key) {
6767
int idx = -1;
68-
for(int i=0; i<key.length();i++) {
68+
for(int i = 0; i < key.length(); i++) {
6969
if(key.charAt(i) == c) {
7070
idx = i;
7171
}

0 commit comments

Comments
 (0)