Methods

public bytes ([mixed $len])

Generates a random binary string
The Random::bytes method returns a string and accepts as input an int
representing the length in bytes to be returned.
If $len is not specified, 16 is assumed. It may be larger in future.
The result may contain any byte: “x00” - “xFF”.

Generates a random base58 string
If $len is not specified, 16 is assumed. It may be larger in future.
The result may contain alphanumeric characters except 0, O, I and l.
It is similar to Phalcon\Security\Random:base64 but has been modified to avoid both non-alphanumeric
characters and letters which might look ambiguous when printed.

Generates a random base62 string
If $len is not specified, 16 is assumed. It may be larger in future.
It is similar to Phalcon\Security\Random:base58 but has been modified to provide the largest value that can
safely be used in URLs without needing to take extra characters into consideration because it is [A-Za-z0-9].

Generates a random base64 string
If $len is not specified, 16 is assumed. It may be larger in future.
The length of the result string is usually greater of $len.
Size formula: 4 * ($len / 3) and this need to be rounded up to a multiple of 4.

Generates a random URL-safe base64 string
If $len is not specified, 16 is assumed. It may be larger in future.
The length of the result string is usually greater of $len.
By default, padding is not generated because “=” may be used as a URL delimiter.
The result may contain A-Z, a-z, 0-9, “-“ and “_”. “=” is also used if $padding is true.
See RFC 3548 for the definition of URL-safe base64.

Generates a v4 random UUID (Universally Unique IDentifier)
The version 4 UUID is purely random (except the version). It doesn’t contain meaningful
information such as MAC address, time, etc. See RFC 4122 for details of UUID.
This algorithm sets the version number (4 bits) as well as two reserved bits.
All other bits (the remaining 122 bits) are set using a random or pseudorandom data source.
Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is any hexadecimal
digit and y is one of 8, 9, A, or B (e.g., f47ac10b-58cc-4372-a567-0e02b2c3d479).