Password Generator

The PasswordGenerator class is used to generate the com.tecknobit.glider.services.passwords.entities.Password for the user who request the generation

Author

N7ghtm4r3 - Tecknobit

Constructors

Link copied to clipboard
private constructor()
Constructor to instantiate the object

Properties

Link copied to clipboard
private val BASE_OFFSET: Int = 26
BASE_OFFSET the base offset from the CHARACTERS lowercase letters
Link copied to clipboard
private val CHARACTERS: Array<Char>
CHARACTERS the available characters to generate a password
Link copied to clipboard
private val DIGITS: HashSet<Character>
DIGITS the digits characters available to generate a password
Link copied to clipboard
generator the singleton instance of the generator
Link copied to clipboard
SPECIAL_CHARACTERS the special characters available to generate a password
Link copied to clipboard
UPPERCASE_LETTERS the uppercase letters characters available to generate a password

Functions

Link copied to clipboard
private open fun constraintsValid(    character: Char,     includeNumbers: Boolean,     includeUppercaseLetters: Boolean,     includeSpecialCharacters: Boolean): Boolean
Method used to check whether the generated character respect the constraints requested by the user
Link copied to clipboard
private open fun convertToString(rawPassword: ArrayList<Character>): String
Method used to convert the list of the generated password characters as concatenated string
Link copied to clipboard
open fun generatePassword(configuration: PasswordConfiguration): String
open fun generatePassword(length: Int, includeNumbers: Boolean, includeUppercaseLetters: Boolean, includeSpecialCharacters: Boolean): String
Method used to generate a password
Link copied to clipboard
private open fun getDigitsValidIndex(secureRandom: SecureRandom): Int
Method used to get a valid index from the DIGITS set
Link copied to clipboard
Method used to obtain the instance of the generator
Link copied to clipboard
private open fun getSpecialCharactersValidIndex(secureRandom: SecureRandom): Int
Method used to get a valid index from the SPECIAL_CHARACTERS set
Link copied to clipboard
private open fun getUppercaseLettersValidIndex(secureRandom: SecureRandom): Int
Method used to get a valid index from the UPPERCASE_LETTERS set
Link copied to clipboard
private open fun guaranteeConstraintCharacters(    password: ArrayList<Character>,     secureRandom: SecureRandom,     includeNumbers: Boolean,     includeUppercaseLetters: Boolean,     includeSpecialCharacters: Boolean)
Method used to guarantee the password has the requested constraint characters