Example #1
0
File: Guid.php Project: ud223/yj
 public function toString()
 {
     $address = NetAddress::getLocalHost();
     $this->valueBeforeMD5 = $address->toString() . ':' . System::currentTimeMills() . ':' . Random::nextLong();
     $this->valueAfterMD5 = md5($this->valueBeforeMD5);
     $raw = strtoupper($this->valueAfterMD5);
     return substr($raw, 0, 8) . '-' . substr($raw, 8, 4) . '-' . substr($raw, 16, 4) . '-' . substr($raw, 20);
 }
Example #2
0
 function getGuid()
 {
     $address = NetAddress::getLocalHost();
     $this->valueBeforeMD5 = $address->toString() . ':' . System::currentTimeMillis() . ':' . Random::nextLong();
     $this->valueAfterMD5 = md5($this->valueBeforeMD5);
 }