This repository contains a simple password validation script implemented in various programming languages. The script checks the strength of a password based on length, special characters, and numbers.
- Python 3.x
- Run the script.
- Input your password when prompted.
- Review the summary to see the strength of your password.
- The Python script embraces Object-Oriented Programming (OOP) principles.
- The
PasswordValidator
class encapsulates attributes (password
andstrength
) and methods (validate_length
,validate_special_chars
,validate_numbers
,validate_spaces
,display_password
, andsummary
) related to password validation. - The constructor (
__init__
method) initializes the object with an initial state. - Methods utilize parameters for flexibility in validation based on special characters and numbers.
- The code follows the principles of encapsulation, grouping data and related functionality within the class.
- Node.js
- Run the script.
- Input your password when prompted.
- Review the summary to see the strength of your password.
- The JavaScript script implements OOP through object creation using prototypes.
- Functions act as methods of the
PasswordValidator
object, encapsulating the logic. - The
password
andstrength
are properties of the object. - The script follows the principles of encapsulation, where related data and functions are organized within an object.
- Ruby
- Run the script.
- Input your password when prompted.
- Review the summary to see the strength of your password.
- The Ruby script embraces OOP principles.
- The
PasswordValidator
class encapsulates attributes (password
andstrength
) and methods (validate_length
,validate_special_chars
,validate_numbers
,validate_spaces
,display_password
, andsummary
) related to password validation. - The constructor initializes the object with an initial state.
- Methods use parameters for flexibility in validation based on special characters and numbers.
- The code demonstrates encapsulation, grouping data and related functionality within the class.
- PHP
- Run the script.
- Input your password when prompted.
- Review the summary to see the strength of your password.
- The PHP script incorporates OOP concepts.
- The
PasswordValidator
class features attributes (password
andstrength
) and methods (validate_length
,validate_special_chars
,validate_numbers
,validate_spaces
,display_password
, andsummary
) for password validation. - The constructor initializes the object with an initial state.
- Methods use parameters for flexibility in validation based on special characters and numbers.
- The code exemplifies encapsulation, organizing data and related functionality within the class.
- GCC Compiler
- Compile the program:
gcc password_validator.c -o password_validator
- Run the executable.
- Input your password when prompted.
- Review the summary to see the strength of your password.
- While C is not inherently an object-oriented language, the script emulates some OOP principles.
- It organizes functionality related to password validation in functions.
- The data (password and strength) is managed through function parameters.
- The script lacks true encapsulation and inheritance due to C's procedural nature.
- C++ Compiler
- Compile the program:
g++ password_validator.cpp -o password_validator
- Run the executable.
- Input your password when prompted.
- Review the summary to see the strength of your password.
- The C++ script adheres to object-oriented principles.
- The
PasswordValidator
class encapsulates attributes (password
andstrength
) and methods (validate_length
,validate_special_chars
,validate_numbers
,validate_spaces
,display_password
, andsummary
) related to password validation. - The constructor initializes the object with an initial state.
- Methods use parameters for flexibility in validation based on special characters and numbers.
- The code exemplifies encapsulation, where data and related functionality are grouped within the class.
- Java Development Kit (JDK)
- Compile the program:
javac PasswordValidator.java
- Run the compiled program:
java PasswordValidator
- Input your password when prompted.
- Review the summary to see the strength of your password.
- The Java script embraces OOP principles.
- The
PasswordValidator
class encapsulates attributes (password
andstrength
) and methods (validate_length
,validate_special_chars
,validate_numbers
,validate_spaces
,display_password
, andsummary
) for password validation. - The constructor initializes the object with an initial state.
- Methods use parameters for flexibility in validation based on special characters and numbers.
- The code exemplifies encapsulation, where data and related functionality are grouped within the class.
- Go Programming Language
- Run the script.
- Input your password when prompted.
- Review the summary to see the strength of your password.
- Golang supports OOP concepts, but it takes a unique approach.
- While it doesn't have classes in the traditional sense, it uses struct types and methods associated with those types.
- The script uses a struct
PasswordValidator
with associated methods (validateLength
,validateSpecialChars
,validateNumbers
,validateSpaces
,displayPassword
, andsummary
) to achieve OOP-like encapsulation.
Feel free to customize and expand the information based on the specifics of your implementation or any additional details you'd like to include.