Generates a device fingerprint.

@return string
@throws LoginException
169681
private function getDeviceFingerprint()
    {
        $server = $this->httpRequest()->server();

        $did = '';
        //$did .= $server->httpAccept();
        //$did .= '|' . $server->httpAcceptCharset();
        //$did .= '|' . $server->httpAcceptEncoding();
        $did .= '|' . $server->httpAcceptLanguage();

        // append browser details
        if (empty($server->httpUserAgent())) {
            throw new LoginException('Unable to process the request without a user agent', 100);
        }

        $platform = 'unknown';
        $ub = 'unknown';

        // get the platform
        $ua = $server->httpUserAgent();
        if (preg_match('/linux/i', $ua)) {
            $platform = 'linux';
        } elseif (preg_match('/macintosh|mac os x/i', $ua)) {
            $platform = 'mac';
        } elseif (preg_match('/windows|win32/i', $ua)) {
            $platform = 'windows';
        }

        // get browser name
        if (preg_match('/MSIE/i', $ua) && !preg_match('/Opera/i', $ua)) {
            $ub = "MSIE";
        } elseif (preg_match('/Firefox/i', $ua)) {
            $ub = "Firefox";
        } elseif (preg_match('/Chrome/i', $ua)) {
            $ub = "Chrome";
        } elseif (preg_match('/Safari/i', $ua)) {
            $ub = "Safari";
        } elseif (preg_match('/Opera/i', $ua)) {
            $ub = "Opera";
        } elseif (preg_match('/Netscape/i', $ua)) {
            $ub = "Netscape";
        }

        $did .= '|' . $platform;
        $did .= '|' . $ub;

        return md5($did);
    }
645959
protected function generateSignature()
    {
        $signature  = $this->getMerchantPassword();
        $signature .= $this->getMerchantId();
        $signature .= $this->getAcquirerId();

        return base64_encode( sha1($signature, true) );
    }
1265600
public OmemoFingerprint getFingerprint(OmemoDevice userDevice)
            throws CorruptedOmemoKeyException {

        T_IdKeyPair keyPair = loadOmemoIdentityKeyPair(userDevice);
        if (keyPair == null) {
            return null;
        }

        return keyUtil().getFingerprintOfIdentityKey(keyUtil().identityKeyFromPair(keyPair));
    }
360126
public function generateSigninInput()
    {
        $base64payload = $this->encoder->encode(json_encode($this->getPayload(), JSON_UNESCAPED_SLASHES));
        $base64header = $this->encoder->encode(json_encode($this->getHeader(), JSON_UNESCAPED_SLASHES));

        return sprintf('%s.%s', $base64header, $base64payload);
    }
135885
public function getDeviceValidationToken()
    {
        $username = $this->httpRequest()->post('username');
        $token = $this->getLoginInstance()->generateDeviceValidationToken($username);

        return ['deviceValidationToken' => $token];
    }
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;
    }
684575
public function generateSecret()
    {
        $secret = bin2hex(random_bytes(20));
        $this->secret = password_hash($secret, PASSWORD_DEFAULT);

        return $secret;
    }
624384
public function getIdStringAttribute()
    {
        $key = $this->getKeyName();
        return (property_exists($this, 'uuidOptimization') && $this::$uuidOptimization)
            ? self::toNormal($this->attributes[$key]) : bin2hex($this->attributes[$key]);
    }
164444
public function getIdentityString() {
		if (!is_array($this->throwableArray)) {
			$renderer = new \n2n\log4php\renderer\RendererException();
			
			$this->throwableArray = explode("\n", $renderer->render($this->throwable));
		}
		
		return $this->throwableArray;
	}
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;
    }
745496
public static function generateUUID() :string
    {
        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)
        );
    }
389767
public static function generateUid():string
    {
        static $uid = null;
        if ($uid === null) {
            $now = \DateTime::createFromFormat('U.u', microtime(true), static::timezone());
            $uid = md5($now->format("Y-m-d\TH:i:s.uO"));
        }
        return $uid;
    }
1304763
public static function generateId()
    {
        static $inc = 0;

        $ts = pack('N', time());
        $m = substr(md5(gethostname()), 0, 3);
        $pid = pack('n', 1);
        $trail = substr(pack('N', $inc++), 1, 3);

        $bin = sprintf('%s%s%s%s', $ts, $m, $pid, $trail);
        $id = '';
        for ($i = 0; $i < 12; $i++) {
            $id .= sprintf('%02X', ord($bin[$i]));
        }

        return strtolower($id);
    }
171524
protected function getUniqueLoginKey()
    {
        $key = $this->request->input($this->loginKey);
        $ip = $this->request->ip();

        return \mb_strtolower($key).$ip;
    }
275104
private void initInstanceFingerprint() {

        Properties properties = System.getProperties();

        int port = 0;

        // get host
        String host = properties.getProperty("VCAP_APP_HOST");
        if (host == null) {

            InetAddress addr;
            try {
                addr = InetAddress.getLocalHost();
                host = addr.getHostName();
            } catch (UnknownHostException e) {
                LOGGER.info("");
            }

        } else {
            // get port
            try {
                port = Integer.parseInt(properties.getProperty("VCAP_APP_HOST"));
            } catch (Exception e) {
                LOGGER.info("");
            }
        }

        instanceFingerprint = new InstanceFingerprint(host, port, UUID.randomUUID().toString());
    }
258972
public function generatePadID(): string
    {
        $chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
        $length = 16;
        $padID = "";

        for ($i = 0; $i < $length; $i++) {
            $padID .= $chars[rand() % strlen($chars)];
        }

        return $padID;
    }
421764
public static function getDeviceSuffix(){
		if(empty(self::$devicesuffix)){
			$device=self::detectDevice();
			if($device==DEVICE_TYPE_MPHONE){
				self::$devicesuffix='.m';
				}
			elseif($device==DEVICE_TYPE_TABLET){
				self::$devicesuffix='.m';
				}else{
				self::$devicesuffix='.d';
				}
			}
		return self::$devicesuffix;
		}