\CryptoManana\Core\Interfaces\RandomnessStringOutputInterface

Interface StringOutputInterface - Interface for random string generation.

Summary

Methods
Constants
getDigit()
getLetter()
getAlphaNumeric()
getAscii()
getString()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getDigit()

getDigit(boolean  $includeZero = true) : string

Generate a random digit character.

Parameters

boolean $includeZero

Flag for including the zero digit (default => true).

Returns

string —

Randomly generated digit character.

getLetter()

getLetter(boolean  $caseSensitive = true) : string

Generate a random english letter character.

Parameters

boolean $caseSensitive

Flag for enabling case sensitive generation (default => true).

Returns

string —

Randomly generated english letter character.

getAlphaNumeric()

getAlphaNumeric(integer  $length = 1, boolean  $caseSensitive = true) : string

Generate a random alphanumeric string.

Parameters

integer $length

The output string length (default => 1).

boolean $caseSensitive

Flag for enabling case sensitive generation (default => true).

Returns

string —

Randomly generated alphanumeric string.

getAscii()

getAscii(integer  $length = 1, boolean  $includeSpace = false) : string

Generate a random ASCII (American Standard Code) string containing only printable characters.

Parameters

integer $length

The output string length (default => 1).

boolean $includeSpace

Flag for including the space character (default => true).

Returns

string —

Randomly generated ASCII string.

getString()

getString(integer  $length = 1, array  $characters = array()) : string

Generate a random string with custom characters.

Parameters

integer $length

The output string length (default => 1).

array $characters

The character map for the string generation (default => ASCII).

Returns

string —

Randomly generated string using a custom character map.