getBool()
getBool() : boolean
Generate a random boolean.
Throws
- \Exception
Validation errors.
Returns
boolean —Randomly generated boolean value.
Trait ArbitraryBaseOutputTrait - Reusable implementation of `ArbitraryBaseOutputInterface`.
getTernary(boolean|integer $asInteger = true) : boolean|integer
Generate a random ternary format (-1, 0, 1).
Note: Passing false
to the $asInteger
parameter will convert values
to null
, false
and true
.
boolean|integer | $asInteger | Flag for returning as integer (default => true). |
Validation errors.
Randomly generated ternary value.
getHex(integer $length = 1, boolean $upperCase = false) : string
Generate a random HEX string.
integer | $length | The output string length (default => 1). |
boolean | $upperCase | Flag for using uppercase output (default => false). |
Validation errors.
Randomly generated HEX string.
getBase64(integer $length = 1, boolean $urlFriendly = false) : string
Generate a random Base64 string.
integer | $length | The internal byte string length (default => 1). |
boolean | $urlFriendly | Flag for using URL friendly output (default => false). |
Validation errors.
Randomly generated Base64 RFC 4648 standard string.