Generate a new snowflake id.

@return string
174980
public function nextId()
    {
        $timestamp = time() - static::BASE_TIME;

        if ($this->lastTimestamp >= $timestamp) {
            $timestamp = $this->lastTimestamp;

            $sequence = ++ $this->sequence;

            if ($sequence > 0x7ff) {
                $this->lastTimestamp = ++ $timestamp;

                $sequence = $this->sequence = 0;
            }
        } else {
            $this->lastTimestamp = $timestamp;

            $sequence = $this->sequence = 0;
        }

        return ($timestamp << 32) | $this->mask | ($sequence & 0x7ff);
    }
205790
public function generateId()
    {
        if ($this->idAttributeType == static::$idTypeInteger) {
            do {
                $result = Number::randomNumber($this->idAttributePrefix, $this->idAttributeLength);
            } while ($this->checkIdExists((int) $result));
            return $result;
        }
        if ($this->idAttributeType == static::$idTypeString) {
            return $this->idAttributePrefix .
                Yii::$app->security->generateRandomString($this->idAttributeLength - strlen($this->idAttributePrefix));
        }
        if ($this->idAttributeType == static::$idTypeAutoIncrement) {
            return null;
        }
        return false;
    }
925789
public function createIqId()
    {
      $iqId = $this->iqCounter;
      $this->iqCounter++;
      $id = dechex($iqId);

      return $id;
    }
92971
public function get_unique_id() {
        global $CFG;

        if (!is_null($this->uniqueid)) {
            return $this->uniqueid;
        }

        // Generate a unique id for this site, this model and this time splitting method, considering the last time
        // that the model target and indicators were updated.
        $ids = array($CFG->wwwroot, $CFG->prefix, $this->model->id, $this->model->version);
        $this->uniqueid = sha1(implode('$$', $ids));

        return $this->uniqueid;
    }
84222
public function renewId()
    {

        // create a new session ID
        $this->setId(SessionUtils::generateRandomString());

        // load the session manager
        $sessionManager = $this->getContext()->search(SessionManagerInterface::IDENTIFIER);

        // attach this session with the new ID
        $sessionManager->attach($this->getSession());

        // create a new cookie with the session values
        $cookie = new HttpCookie(
            $this->getName(),
            $this->getId(),
            $this->getLifetime(),
            $this->getMaximumAge(),
            $this->getDomain(),
            $this->getPath(),
            $this->isSecure(),
            $this->isHttpOnly()
        );

        // add the cookie to the response
        $this->getRequest()->setRequestedSessionId($this->getId());
        $this->getResponse()->addCookie($cookie);

        // return the new session ID
        return $this->getId();
    }
931574
protected function id()
    {
        while (true) {
            $id = \uniqid('crunz', true);
            if (!\array_key_exists($id, $this->events)) {
                return $id;
            }
        }
    }
1209078
public static function generateIdentityKeyPair()
    {
        $keyPair = Curve::generateKeyPair();
        $publicKey = new IdentityKey($keyPair->getPublicKey());
        $serialized = '0a21056e8936e8367f768a7bba008ade7cf58407bdc7a6aae293e2cb7c06668dcd7d5e12205011524f0c15467100dd6'.
                     '03e0d6020f4d293edfbcd82129b14a88791ac81365c';
        $serialized = pack('H*', $serialized);
        $identityKeyPair = new IdentityKeyPair($publicKey, $keyPair->getPrivateKey());

        return $identityKeyPair;
        // return new IdentityKeyPair(serialized=serialized)
    }
816122
public function id() {
		$res = $this->_match;
		$count = count($res);

		if (empty($this->_stub['id'])) {
			if (empty($res[$count - 1])) {
				return '';
			}
			$this->_stub['id'] = $res[$count - 1];
		}
		$id = $this->_stub['id'];

		for ($i = 1; $i <= $count; $i++) {
			$id = str_ireplace('$' . $i, $res[$i - 1], $id);
		}
		return $id;
	}
160241
private static function generatePoolClientId()
    {
        $now = ceil(microtime(true) * 10000);
        if (class_exists('Reaction', false)) {
            $rand = \Reaction::$app->security->generateRandomString(8);
        } else {
            $rand = static::randomStr();
        }
        return static::getClientIdPrefix() . $now . $rand;
    }
219861
public function id()
    {
        // just return any string since the Cookie storage has no idea.
        if ($this instanceof \Pimf\Session\Storages\Cookie) {
            return Character::random(40);
        }

        // we'll find an random ID here.
        do {
            $session = $this->load($key = Character::random(40));
        } while ($session !== null);

        return $key;
    }
470239
protected function getId()
  {
    if($this->currObj instanceof TeamSpeak3_Node_Server)
    {
      return "ts3_s" . $this->currObj->virtualserver_id;
    }
    elseif($this->currObj instanceof TeamSpeak3_Node_Channel)
    {
      return "ts3_c" . $this->currObj->cid;
    }
    elseif($this->currObj instanceof TeamSpeak3_Node_Client)
    {
      return "ts3_u" . $this->currObj->clid;
    }

    return FALSE;
  }
272465
public function generateId()
    {
        $data = openssl_random_pseudo_bytes(16);
        $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
        $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10

        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
    }
1334791
protected function generateId(): int
    {
        if ($this->getId() !== null) {
            return $this->getId();
        }

        $maxIdLength = \mb_strlen((string) PHP_INT_MAX) - 1;

        // try generate unique id for file
        $id = mb_substr(crc32($this->getModelId()), $maxIdLength - self::ID_PATH_HASH_LENGTH)
            . mb_substr(crc32($this->getActualPath()), self::ID_PATH_HASH_LENGTH);

        return (int) $id;
    }
72108
protected function generateIdentifier()
	{
		// If the mongo extension is loaded, utilize it to generate a UUID.
		if(extension_loaded('mongodb'))
		{
			$newObjectId = new \MongoDB\BSON\ObjectID();

			$uuid = $newObjectId->__toString();
		}
		else
		{
			$uuid = bin2hex(openssl_random_pseudo_bytes(12));
		}

		return $uuid;
	}
496475
public function id() : string
    {
        $name = $this->name();
        $name = preg_replace("@\[\]$@", '', $name);
        if ($name) {
            return $name.'-'.$this->value;
        }
        return $name;
    }
1049187
public function getIdField()
    {
        if (empty($this->id_field)) {
            $this->id_field = (new IntegerField('id', 0))->unsigned(true)->size($this->getExpectedDatasetSize());
        }

        return $this->id_field;
    }
320322
public function generate()
    {
        if ($this->_getOpenSSLFunctionalityChecker()->isOpenSslRandomBytesGeneratorAvailable()) {
            $sSalt = bin2hex(openssl_random_pseudo_bytes(16));
        } else {
            $sSalt = $this->_customSaltGenerator();
        }

        return $sSalt;
    }