This commit is contained in:
@@ -24,12 +24,12 @@ public class Caesar {
|
||||
char current = encoded[i];
|
||||
int pos = alphabet.indexOf(current);
|
||||
if(pos != -1) {
|
||||
int newpos = alphabet.indexOf((pos + key) % 26);
|
||||
int newpos = (pos + key) % 26;
|
||||
decoded[i] = alphabet.charAt(newpos);
|
||||
} else
|
||||
decoded[i] = current;
|
||||
}
|
||||
bruteforce[key] = String.valueOf(encoded);
|
||||
bruteforce[key] = String.valueOf(decoded);
|
||||
}
|
||||
return bruteforce;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user