This repository was archived by the owner on Dec 8, 2022. It is now read-only.
forked from mako-framework/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Learn more: Uuid helper
Marco Montalbano edited this page Jul 31, 2017
·
1 revision
The UUID class contains methods used to validate and generate UUIDs.
The validate method checks if a string is a valid UUID. It will return TRUE if is does and FALSE if not.
$valid = UUID::validate('f47ac10b-58cc-4372-a567-0e02b2c3d479'); // TRUE
$valid = UUID::validate('x47ac10b-58cc-4372-a567-0e02b2c3d479'); // FALSE
The v3 method will generate and return a version 3 UUID.
// The namespace must be a valid UUID
$uuid = UUID::v3('f47ac10b-58cc-4372-a567-0e02b2c3d479', 'foobar');
// You can also use one of the predefined namespaces (DNS, URL, OID and X500)
$uuid = UUID::v3(UUID::OID, 'foobar');
The v4 method will return a version 4 UUID.
$uuid = UUID::v4();
The v5 method will return a version 5 UUID.
// The namespace must be a valid UUID
$uuid = UUID::v5('f47ac10b-58cc-4372-a567-0e02b2c3d479', 'foobar');
// You can also use one of the predefined namespaces (DNS, URL, OID and X500)
$uuid = UUID::v5(UUID::OID, 'foobar');
- Getting started: Installation
- Getting started: Configuration
- Getting started: Error handling
- Getting started: Constants
- Getting started: Coding standards
- Controllers: Controllers
- Controllers: Request
- Controllers: Response
- Databases: Basics
- Databases: Query builder
- Databases: Orm
- Databases: Migrations
- Command line: Basics
- Command line: Custom tasks
- Packages: Basics
- Packages: Composer packages
- Learn more: Array helper
- Learn more: Asset manager
- Learn more: Autoloading
- Learn more: Caching
- Learn more: Cookies
- Learn more: Events
- Learn more: File helper
- Learn more: Html helper
- Learn more: Internationalization
- Learn more: Logging
- Learn more: Number helper
- Learn more: Pagination
- Learn more: Redis client
- Learn more: Rest client
- Learn more: Security helpers
- Learn more: Sessions
- Learn more: String helper
- Learn more: Url helper
- Learn more: Uuid helper
- Learn more: Validation
- Learn more: Views