|
Login Languish
|
handles password verification tasks More...
#include <string>#include <vector>#include <algorithm>

Go to the source code of this file.
Functions | |
| bool | password_utils::isPalindrome (std::string input) |
| checks if a string is a palindrome More... | |
| bool | password_utils::isPrime (int n) |
| checks if a number is prime More... | |
| bool | password_utils::hasPrime (std::string input) |
| checks if a string contains a prime number More... | |
| bool | password_utils::hasColour (std::string input) |
| checks if a string contains a colour More... | |
handles password verification tasks
| bool password_utils::hasColour | ( | std::string | input | ) |
checks if a string contains a colour
iterates through list of colours and checks whether a lowercase copy of the input string contains the colour.
| input | the string to be checked for colours |
| bool password_utils::hasPrime | ( | std::string | input | ) |
checks if a string contains a prime number
checks through strings for entire numbers (15 will be read as 15, not 1 and 5) before checking if any of those numbers are prime.
| input | the string to be checked for prime numbers |
| bool password_utils::isPalindrome | ( | std::string | input | ) |
checks if a string is a palindrome
iterates through the first half of the string and checks it is being mirrored in the other half
| input | the string to be checked |
| bool password_utils::isPrime | ( | int | n | ) |
checks if a number is prime
checks base cases before iterating through all integers up to the square root of the number being checked.
| n | the integer to be checked |
1.8.13