本文整理汇总了PHP中Uuid::uuid3方法的典型用法代码示例。如果您正苦于以下问题:PHP Uuid::uuid3方法的具体用法?PHP Uuid::uuid3怎么用?PHP Uuid::uuid3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uuid
的用法示例。
在下文中一共展示了Uuid::uuid3方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUsingNilAsValidUuid
/**
* @covers Rhumsaa\Uuid\Uuid::isValid
*/
public function testUsingNilAsValidUuid()
{
$this->assertInstanceOf('Rhumsaa\\Uuid\\Uuid', Uuid::uuid3(Uuid::NIL, 'randomtext'));
$this->assertInstanceOf('Rhumsaa\\Uuid\\Uuid', Uuid::uuid5(Uuid::NIL, 'randomtext'));
}
示例2: testUuid3WithNamespaceAsUuidString
/**
* The "python.org" UUID is a known entity, so we're testing that this
* library generates a matching UUID for the same name.
* @see http://docs.python.org/library/uuid.html
*
* @covers Rhumsaa\Uuid\Uuid::uuid3
* @covers Rhumsaa\Uuid\Uuid::uuidFromHashedName
*/
public function testUuid3WithNamespaceAsUuidString()
{
$uuid = Uuid::uuid3(Uuid::NAMESPACE_DNS, 'python.org');
$this->assertEquals('6fa459ea-ee8a-3ca4-894e-db77e160355e', $uuid->toString());
$this->assertEquals(2, $uuid->getVariant());
$this->assertEquals(3, $uuid->getVersion());
}