PHP code example of cxj / uuid

1. Go to this page and download the library: Download cxj/uuid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cxj / uuid example snippets




$namespace_uuid = '1546058f-5a25-4334-85ae-e68f2a44bbaf';

// Some meaningful string, e.g. fully-qualified domain name, URL, distinguished
// name, or any other textual name.
$name = 'http://example.com/';

$v4uuid = UUID::v4();
$v5uuid = UUID::v5($v4uuid, $name);
$v5uuid2 = UUID::v5($namespace_uuid, $name);


echo "v4: $v4uuid" .PHP_EOL;
echo "v5: $v5uuid" .PHP_EOL;
echo "v5: $v5uuid2" .PHP_EOL;