예제 #1
0
 public function testFieldCrud()
 {
     $uuid = new Uuid('b8fc7a3e-0331-11e4-9583-080027f3add4');
     $this->assertTrue($uuid->isValid());
     $this->assertEquals('9583', $uuid->getField('clock_seq'));
     $uuid->setField('clock_seq', 'ffff');
     $this->assertEquals($uuid->toFormat(new PlainString()), 'b8fc7a3e-0331-11e4-ffff-080027f3add4');
 }
예제 #2
0
파일: Variant.php 프로젝트: vend/mysql-uuid
 /**
  * @param string $byte A single byte
  * @return string
  */
 protected function setVariantByte($byte)
 {
     $bin = hex2bin($this->uuid->getField('clock_seq'));
     $bin[0] = $byte;
     $this->uuid->setField('clock_seq', bin2hex($bin));
 }