Generates a new identifier.
@return string generated identifier
326165
public function generate()
    {
        $str     = '';
        $keysize = strlen($this->_alphabet);

        for ($i = 0; $i < $this->_length; ++$i) {
            $str .= $this->_alphabet[\Sodium\randombytes_uniform($keysize)];
        }

        return $str;
    }
581184
public function getId()
    {
        return sprintf(
          '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
          mt_rand(0, 0x0fff) | 0x4000,
          mt_rand(0, 0x3fff) | 0x8000,
          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
1051335
protected function createId()
	{
		$id = 0;

		while (strlen($id) < 32)
		{
			$id .= mt_rand(0, mt_getrandmax());
		}

		return md5(uniqid($id, true));
	}
1248344
public function generate_guid()
	{
	    return sprintf(
			'%04X%04X-%04X-%04X-%04X-%04X%04X%04X',
			mt_rand(0, 65535),
			mt_rand(0, 65535),
			mt_rand(0, 65535),
			mt_rand(16384, 20479),
			mt_rand(32768, 49151),
			mt_rand(0, 65535),
			mt_rand(0, 65535),
			mt_rand(0, 65535)
		);
	}
925789
public function createIqId()
    {
      $iqId = $this->iqCounter;
      $this->iqCounter++;
      $id = dechex($iqId);

      return $id;
    }
745221
public function getSerialId()
    {
        if($this->id)
            return $this->id;
        $id = $this->generateSerialId();
        $this->setId( $id );
        return $id;
    }
945831
public function generate(): string
    {
        $classCode = $this->generator->generate();

        return $classCode
            // Inject advices on call
            . '\\' . __CLASS__ . '::injectJoinPoints(' . $this->generator->getName() . '::class);';
    }
765994
public function getIdentifier()
    {
        $identifier = $this->getFromNode()->getIdentifier() 
                    . '-'
                    . $this->getType()
                    . '-'
                    . $this->getToNode()->getIdentifier();
        
        return $identifier;
    }
45594
final function _generateID()
    {
        $uniqStr = function($length) {
            $char = "abcdefghijklmnopqrstuvwxyz0123456789";
            $char = str_shuffle($char);
            for($i = 0, $rand = '', $l = strlen($char) - 1; $i < $length; $i ++) {
                $rand .= $char{mt_rand(0, $l)};
            }

            return $rand;
        };

        if ($this->ID == null) {
            $class     = get_called_class();
            $module    = $this->deriveModuleNamespace($class);
            $widget    = $this->deriveWidgetName($class);

            $this->ID  = (($module != '') ? $this->inflectName($module).'_' : '')
                .$this->inflectName($widget).'_'.$uniqStr(5);
        }

        return $this->ID;
    }
682118
public function newUuid(){
        $q = Db::query('SELECT REPLACE(UUID(),"-","") as id');

        while($row = $q['result']->fetch_assoc()){
            $this->uuid = strtoupper($row['id']);
        }
        return $this;
    }
655003
protected function generateUUID()
        {
        $uuid = null;
        if ($this->useUUIDs) {
            $sql    = 'SELECT UUID() as id';
            $result = $this->database->fetchAssoc($sql);
            $uuid   = $result['id'];
        }
        return $uuid;
    }
1003203
public function generate(): string
    {
        $uniqueId = uniqid((string) rand(), true);

        return (string) md5($uniqueId);
    }
725372
public function getId()
    {
        $class = get_class($this);
        $id = lcfirst(explode('\\', $class)[1]);
        $id = $this->str->dash($id);

        return $id;
    }
752761
public function getIdentifier() : ?int 
    {
        if ( ! $this->hasIdentifier()) {
            $this->setIdentifier($this->getDefaultIdentifier());
        }
        return $this->identifier;
    }
800306
private function generate()
    {
        $characters = config('promocodes.characters');
        $mask = config('promocodes.mask');
        $promocode = '';
        $random = [];

        for ($i = 1; $i <= $this->length; $i++) {
            $character = $characters[rand(0, strlen($characters) - 1)];
            $random[] = $character;
        }

        shuffle($random);
        $length = count($random);

        $promocode .= $this->getPrefix();

        for ($i = 0; $i < $length; $i++) {
            $mask = preg_replace('/\*/', $random[$i], $mask, 1);
        }

        $promocode .= $mask;
        $promocode .= $this->getSuffix();

        return $promocode;
    }
139081
private function generateUuid()
    {
        $args = $this->version;
        $fn = 'uuid'.array_shift($args);

        return call_user_func_array('Ramsey\Uuid\Uuid::'.$fn, $args);
    }
496475
public function id() : string
    {
        $name = $this->name();
        $name = preg_replace("@\[\]$@", '', $name);
        if ($name) {
            return $name.'-'.$this->value;
        }
        return $name;
    }