PHP code example of tankfairies / guid

1. Go to this page and download the library: Download tankfairies/guid 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/ */

    

tankfairies / guid example snippets


use Tankfairies\Guid\Guid;

$guid = new Guid();
$guidToken = $guid->generate(
    GuidInterface::UUID_TIME,
    GuidInterface::FMT_STRING,
    'thesalt'
);

use Tankfairies\Guid\Guid;

$guid = new Guid();
$guidToken = $guid->generate(
    GuidInterface::UUID_NAME_MD5,
    GuidInterface::FMT_STRING,
    'thesalt',
    'thenamespace'
);

use Tankfairies\Guid\Guid;

$guid = new Guid();
$guidToken = $guid->generate(
    GuidInterface::UUID_RANDOM,
    GuidInterface::FMT_STRING
);

use Tankfairies\Guid\Guid;

$guid = new Guid();
$guidToken = $guid->generate(
    GuidInterface::UUID_NAME_SHA1,
    GuidInterface::FMT_STRING
);