Generates dynamic passkey.
Output ex: R.year.O.day.O.month.T : eg R15O25O12T
@return string
505721
public static function dynamicPasskey () : string
    {
        $dateTime 					= date('Y-d-m');
        list($year, $day, $month) 	= explode('-', $dateTime);
        $year 						= substr($year, 2);
        return "R{$year}O{$day}O{$month}T";
    }
24526
protected function generateRegistryItemKey() {
		
		if (!count($this->filteredBy)) {
			return null;
		}
		return md5($this->grid->id . CJSON::encode($this->filteredBy));
	}
489146
final protected function  _getPasswordEntropyDescription(){
        $entropyObj = $this->_getUdfEntropy();
        
        $description    = 'The password entropy requires at minimum, the following: ';
        $hasEntropy     = false;
        $isFirstEntropy = false;
        $concatenator   = '';
        
        if ($entropyObj['lowercase']['min_len'] > 0) {
            $lowercaseLen   = $entropyObj['lowercase']['min_len'];
            $description   .= " at least $lowercaseLen lowercase characters";
            $hasEntropy     = true;
            $isFirstEntropy = true;
        }
        
        if ($entropyObj['uppercase']['min_len'] > 0) {
            $isFirstEntropy = $isFirstEntropy === true?  false : true;
            $concatenator   = $isFirstEntropy === true ? ''    : ',';
            $uppercaseLen   = $entropyObj['uppercase']['min_len'];
            $description   .= "$concatenator at least $uppercaseLen uppercase characters";
            $hasEntropy     = true;     
        }
        
        if ($entropyObj['numeric']['min_len'] > 0) {
            $isFirstEntropy = $isFirstEntropy === true ? false : true;
            $concatenator   = $isFirstEntropy === true ? ''    : ',';
            $numericLen     = $entropyObj['numeric']['min_len'];
            $description   .= "$concatenator at least $numericLen numeric characters";
            $hasEntropy     = true;     
        }

        if ($entropyObj['special']['min_len'] > 0) {
            $isFirstEntropy = $isFirstEntropy === true ? false : true;
            $concatenator   = $isFirstEntropy === true ? ''    : ',';
            $specialLen     = $entropyObj['special']['min_len'];
            $description   .= "$concatenator at least $specialLen special characters";
            $hasEntropy     = true;     
        }
        
        if (!($hasEntropy === true)) {
            $description = 'There is no minimum password entropy policy in place';
        }
        
        return $description;
    }
747305
protected function getKeysToWrite()
    {
        $keys = array_get($this->config, 'keys', ['*']);

        if (in_array('*', $keys)) {
            return $this->getWritableDefaultKeys();
        }

        return $keys;
    }
1309353
public function generatePassword()
    {
        $salts = Site::salts(12);
        $special_char1 = '~<>?|:.(),';
        $special_char2 = '!@#$%^&*_+-*+';
        $pass = $special_char2.$salts.$special_char1;

        return str_shuffle($pass);
    }
1182140
public function key()
    {
        if (is_null($this->ext)) {
            $this->ext = $this->generateExt();
        }
        return $this->ext;
    }
206863
public function generate()
    {
        return sprintf(
            '<input type="hidden" id="ctrl_%s" name="%s" value="%s" /><span>%s</span>',
            $this->strId,
            $this->strName,
            StringUtil::specialchars($this->varValue),
            $this->label
        );
    }
741927
public function getKey(): string
    {
        if ($this->key === null) {
            $this->key = md5($this->getContent());
        }
        return $this->key;
    }
245973
public function genUid() {
    $rand = $this['crypt/rand'];

    $hex = bin2hex($rand->Bytes(32));
    $str = substr($hex,0,16) . '-' . substr($hex,16,8) . '-' . substr($hex,24,8) . '-' . substr($hex,32,8) . '-' . substr($hex,40,24);
    return $str;
  }
540323
public static function genToken(){
        $str = md5(uniqid(mt_rand(), true));
        $uuid  = substr($str,0,8) . '-';
        $uuid .= substr($str,8,4) . '-';
        $uuid .= substr($str,12,4) . '-';
        $uuid .= substr($str,16,4) . '-';
        $uuid .= substr($str,20,12);
        return $uuid;
    }
215315
public function generateKey()
    {
        if (extension_loaded('openssl')) {
            $key = openssl_random_pseudo_bytes(16);
        } else {
            // SHA1 is 128 bit (= 16 bytes)
            $key = sha1(spl_object_hash($this) . mt_rand(0, PHP_INT_MAX) . uniqid('', true), true);
        }

        return base64_encode($key);
    }
1094149
public function generateRandomPassword()
    {
        $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
        $pass = array();
        $alphaLength = strlen($alphabet) - 1;
        for ($i = 0; $i < 8; $i++) {
            $n = rand(0, $alphaLength);
            $pass[] = $alphabet[$n];
        }
        return implode($pass);
    }
384087
private function generateKeys()
    {
        $content = [];
        for ($i = 0; $i < count($this->keys); $i++) {
            $holder = [];
            $value = !$this->option($this->keys[$i]) || $this->option($this->keys[$i]) === 'generate' ? str_random(64) : $this->option($this->keys[$i]);
            $holder['regex'] = str_replace_first($this->findRegExPlaceholder, $this->keys[$i], $this->findRegEx);
            $holder['value'] = $this->keys[$i] . '="' . $value . '"';
            array_push($content, $holder);
        }

        return $content;
    }
136135
public function generateSecurityCode()
    {
        $result = $this->getCertificatePrivateKey();
        $result .= $this->getOib();
        $result .= $this->getDateTime();
        $result .= $this->getInvoiceNumber()->getInvoiceNumber();
        $result .= $this->getInvoiceNumber()->getBusinessLocationCode();
        $result .= $this->getInvoiceNumber()->getPaymentDeviceCode();
        $result .= $this->getTotalValue();

        $this->setSecurityCode(md5($result));

        return $this;
    }
922628
protected function getKeyFromInput() {
        $Model = $this->Model;

        $key = $this->model->getKeyName();
        $id = Input::get($key);

        return $id;
    }
921420
protected function getKeyString()
    {
        $expected = $this->expected;
        $keys = '';
        $tail = array_pop($expected);

        if (!empty($expected)) {
            $keys = implode('","', $expected) . '", and "';
        }

        $keys .= $tail;

        return $keys;
    }
232142
public function getKeyPress()
    {
        $this->disableShowInput();
        $this->disableRequireReturn();

        $input = null;
        while (1) {
            $input = fread(STDIN, 10000);
            break;
        }

        $this->enableShowInput();
        $this->enableRequireReturn();

        $specialKey = $this->detectSpecialKey($input);

        return $specialKey ? $specialKey : (string)$input;
    }