Skip to content

Random


  • Full name: \PhalconKit\Encryption\Security\Random
  • Parent class: Random

Methods

uuidv4

public uuidv4(): string

Throws:

See Also:

  • \Phalcon\Encryption\Security\Random::uuid()

uuidv7

Generates a UUIDv7 (UUID version 7) string based on the Unix timestamp in milliseconds, combined with randomly generated bytes, formatted as a standard UUID string.

public uuidv7(): string

Uses the Unix timestamp and random bytes to create a unique identifier, sets the appropriate version and variant bits, and returns the UUID in a canonical string format.

Return Value:

The generated UUIDv7 string in canonical format (e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).