\CryptoManana\Core\Interfaces\ContainersTokenGenerationInterface

Interface TokenGenerationInterface - Interface for security token and password generation.

Summary

Methods
Constants
getTokenString()
getPasswordString()
PARANOID_PASSWORD_LENGTH
STRONG_PASSWORD_LENGTH
MODERATE_PASSWORD_LENGTH
WEAK_PASSWORD_LENGTH
PARANOID_TOKEN_LENGTH
STRONG_TOKEN_LENGTH
MODERATE_TOKEN_LENGTH
WEAK_TOKEN_LENGTH
No protected methods found
N/A
No private methods found
N/A

Constants

PARANOID_PASSWORD_LENGTH

PARANOID_PASSWORD_LENGTH

The paranoid-enough password character length requirement.

STRONG_PASSWORD_LENGTH

STRONG_PASSWORD_LENGTH

The strong password character length requirement.

MODERATE_PASSWORD_LENGTH

MODERATE_PASSWORD_LENGTH

The moderate password character length requirement.

WEAK_PASSWORD_LENGTH

WEAK_PASSWORD_LENGTH

The weak password character length requirement.

PARANOID_TOKEN_LENGTH

PARANOID_TOKEN_LENGTH

The paranoid-enough token character length requirement.

STRONG_TOKEN_LENGTH

STRONG_TOKEN_LENGTH

The strong token character length requirement.

MODERATE_TOKEN_LENGTH

MODERATE_TOKEN_LENGTH

The moderate token character length requirement.

WEAK_TOKEN_LENGTH

WEAK_TOKEN_LENGTH

The weak token character length requirement.

Methods

getTokenString()

getTokenString(integer  $length = self::MODERATE_TOKEN_LENGTH, boolean|integer  $useAlphaNumeric = true) : string

Generate a random token string in alphanumeric or hexadecimal format.

Note: This method can generate HEX output if the $useAlphaNumeric parameter is set to false.

Parameters

integer $length

The desired output length (default => 32).

boolean|integer $useAlphaNumeric

Flag for switching to alphanumerical (default => true).

Returns

string —

Randomly generated alphanumeric/hexadecimal token string.

getPasswordString()

getPasswordString(integer  $length = self::MODERATE_PASSWORD_LENGTH, boolean|integer  $stronger = true) : string

Generate a random password string.

Note: This method can use more special symbols on generation if the $stronger parameter is set to true.

Parameters

integer $length

The desired output length (default => 12).

boolean|integer $stronger

Flag for using all printable ASCII characters (default => true).

Returns

string —

Randomly generated password string.