本文整理汇总了PHP中UUID::toHex方法的典型用法代码示例。如果您正苦于以下问题:PHP UUID::toHex方法的具体用法?PHP UUID::toHex怎么用?PHP UUID::toHex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::toHex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_include_path
<?php
namespace cd;
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/../core/');
require_once 'UUID.php';
$v3 = UUID::v3('514d2ee9-58ed-49ef-a592-1a49c268e2a2', 'test crap 123');
if ($v3 != "19d179a2-9511-3595-a8e2-490b981e92c2") {
echo "FAIL 1\n";
}
$v5 = UUID::v5('514d2ee9-58ed-49ef-a592-1a49c268e2a2', 'test crap 123');
if ($v5 != "f1b18651-7633-5945-8527-853ddc5b6393") {
echo "FAIL 2\n";
}
$v4 = UUID::v4();
echo "UUID v3 (md5): " . $v3 . "\n";
echo "UUID v5 (sha1): " . $v5 . "\n";
echo "UUID v4 (rand): " . $v4 . "\n";
$hex = UUID::toHex('3F2504E0-4F89-11D3-9A0C-0305E82C3301');
if ($hex != 'E004253F894FD3119A0C0305E82C3301') {
echo "FAIL 3\n";
}