Algorithms
class Algorithms (View source)
A utility class for various algorithms.
Methods
static string
generateUUID()
Generates a universally unique identifier (UUID) according to RFC 4122.
static string
generateRandomBytes(int $count)
Returns a string of random bytes.
static string
generateRandomToken(int $count)
Returns a random token in hex format.
static string
generateRandomString(int $count, string $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
Returns a random string with alpha-numeric characters.
Details
static string
generateUUID()
Generates a universally unique identifier (UUID) according to RFC 4122.
The algorithm used here, might not be completely random.
If php-uuid was installed it will be used instead to speed up the process.
static string
generateRandomBytes(int $count)
Returns a string of random bytes.
static string
generateRandomToken(int $count)
Returns a random token in hex format.
static string
generateRandomString(int $count, string $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
Returns a random string with alpha-numeric characters.