mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
style: enable LocalVariableName in CheckStyle (#5191)
* style: enable LocalVariableName in checkstyle * Removed minor bug * Resolved Method Name Bug * Changed names according to suggestions
This commit is contained in:
@@ -35,7 +35,7 @@ public final class HillCipher {
|
||||
validateDeterminant(keyMatrix, matrixSize);
|
||||
|
||||
int[][] messageVector = new int[matrixSize][1];
|
||||
String CipherText = "";
|
||||
String cipherText = "";
|
||||
int[][] cipherMatrix = new int[matrixSize][1];
|
||||
int j = 0;
|
||||
while (j < message.length()) {
|
||||
@@ -60,10 +60,10 @@ public final class HillCipher {
|
||||
cipherMatrix[i][0] = cipherMatrix[i][0] % 26;
|
||||
}
|
||||
for (i = 0; i < matrixSize; i++) {
|
||||
CipherText += (char) (cipherMatrix[i][0] + 65);
|
||||
cipherText += (char) (cipherMatrix[i][0] + 65);
|
||||
}
|
||||
}
|
||||
System.out.println("Ciphertext: " + CipherText);
|
||||
System.out.println("Ciphertext: " + cipherText);
|
||||
}
|
||||
|
||||
// Following function decrypts a message
|
||||
@@ -84,7 +84,7 @@ public final class HillCipher {
|
||||
|
||||
// solving for the required plaintext message
|
||||
int[][] messageVector = new int[n][1];
|
||||
String PlainText = "";
|
||||
String plainText = "";
|
||||
int[][] plainMatrix = new int[n][1];
|
||||
int j = 0;
|
||||
while (j < message.length()) {
|
||||
@@ -109,10 +109,10 @@ public final class HillCipher {
|
||||
plainMatrix[i][0] = plainMatrix[i][0] % 26;
|
||||
}
|
||||
for (i = 0; i < n; i++) {
|
||||
PlainText += (char) (plainMatrix[i][0] + 65);
|
||||
plainText += (char) (plainMatrix[i][0] + 65);
|
||||
}
|
||||
}
|
||||
System.out.println("Plaintext: " + PlainText);
|
||||
System.out.println("Plaintext: " + plainText);
|
||||
}
|
||||
|
||||
// Determinant calculator
|
||||
|
||||
Reference in New Issue
Block a user