本文整理匯總了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());
}