enrich
3 weeks ago
event-definitions
4 months ago
events
1 week ago
formEvents
1 year ago
logger
4 months ago
views
1 week ago
class-consent.php
6 months ago
class-custom-event-factory.php
1 year ago
class-custom-event.php
3 weeks ago
class-event-definitions.php
4 months ago
class-event-id-generator.php
5 years ago
class-events-manager-ajax_hook.php
3 weeks ago
class-events-manager.php
3 weeks ago
class-fixed-notices.php
1 year ago
class-optin-notices.php
1 year ago
class-pixel.php
7 years ago
class-plugin-updater.php
9 months ago
class-plugin.php
7 years ago
class-pys.php
1 week ago
class-settings.php
4 months ago
functions-admin.php
3 weeks ago
functions-buttons.php
1 year ago
functions-common.php
3 weeks ago
functions-custom-event.php
1 week ago
functions-edd.php
2 years ago
functions-gdpr.php
11 months ago
functions-license.php
3 weeks ago
functions-migrate.php
9 months ago
functions-promo-notices.php
1 year ago
functions-system-report.php
7 years ago
functions-update-plugin.php
6 years ago
functions-woo.php
3 weeks ago
options_defaults.json
3 weeks ago
options_fields.json
3 weeks ago
class-event-id-generator.php
14 lines
| 1 | <?php |
| 2 | namespace PixelYourSite; |
| 3 | |
| 4 | final class EventIdGenerator { |
| 5 | |
| 6 | public static function guidv4() { |
| 7 | $data = openssl_random_pseudo_bytes(16); |
| 8 | |
| 9 | $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100 |
| 10 | $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 |
| 11 | |
| 12 | return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); |
| 13 | } |
| 14 | } |