Created
January 31, 2022 01:06
-
-
Save kylec32/0524de1e96aada49a115309c3610540a to your computer and use it in GitHub Desktop.
Naive Password Check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static boolean verifyPassword(String realPassword, String providedPassword) { | |
if (realPassword.length() != providedPassword.length()) { | |
return false; | |
} | |
for (int i = 0; i < realPassword.length(); i++) { | |
if (realPassword.charAt(i) != providedPassword.charAt(i)) { | |
return false; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment