WordPress at a glance

wp_generate_uuid4() WP 1.0

Generate a random UUID (version 4).

✈ 1 time = 0.s = speed of light | 50000 times = 0.07s = speed of light PHP 7.1.5, WP 4.9.4

No Hooks.

Return

String. UUID.

Usage

wp_generate_uuid4();

Code of wp_generate_uuid4: wp-includes/functions.php VER 4.9.8

<?php
function wp_generate_uuid4() {
	return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
		mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
		mt_rand( 0, 0xffff ),
		mt_rand( 0, 0x0fff ) | 0x4000,
		mt_rand( 0, 0x3fff ) | 0x8000,
		mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
	);
}

Related Functions

From tag: PHP analogues (PHP functions replacement)

More from category: Helper Functions

No comments
    Hello, !     Log In . Register