lib/OTPHelper.php
public function generateKeyURI($type, $secret, $account, $issuer = '', $counter = 0, $algorithm = '', $digits = '', $period = '')
	{
		// Check if type is supported
		$this->validateType($type);
		$this->validateAlgorithm($algorithm);

		// Format label string
		$this->formatLabel($issuer, 'issuer');
		$this->formatLabel($account, 'account');

		// Set additional parameters
		$this->setCounter($type, $counter);
		$this->setParameter($algorithm, 'algorithm');
		$this->setParameter($digits, 'digits');
		$this->setParameter($period, 'period');

		return 'otpauth://' . $type . '/' . $this->label . '?secret=' . $secret . $this->issuer . $this->parameters;
	}
public function generateKeyURI($type, $secret, $account, $issuer = '', $counter = 0, $algorithm = '', $digits = '', $period = '')
	{
		// Check if type is supported
		$this->validateType($type);
		$this->validateAlgorithm($algorithm);

		// Format label string
		$this->formatLabel($issuer, 'issuer');
		$this->formatLabel($account, 'account');

		// Set additional parameters
		$this->setCounter($type, $counter);
		$this->setParameter($algorithm, 'algorithm');
		$this->setParameter($digits, 'digits');
		$this->setParameter($period, 'period');

		return 'otpauth://' . $type . '/' . $this->label . '?secret=' . $secret . $this->issuer . $this->parameters;
	}
public function generateKeyURI ( $ type , $ secret , $ account , $ issuer = '' , $ counter = 0 , $ algorithm = '' , $ digits = '' , $ period = '' ) { // Check if type is supported $ this -> validateType ( $ type ) ; $ this -> validateAlgorithm ( $ algorithm ) ; // Format label string $ this -> formatLabel ( $ issuer , 'issuer' ) ; $ this -> formatLabel ( $ account , 'account' ) ; // Set additional parameters $ this -> setCounter ( $ type , $ counter ) ; $ this -> setParameter ( $ algorithm , 'algorithm' ) ; $ this -> setParameter ( $ digits , 'digits' ) ; $ this -> setParameter ( $ period , 'period' ) ; return 'otpauth://' . $ type . '/' . $ this -> label . '?secret=' . $ secret . $ this -> issuer . $ this -> parameters ; }
Generate OTP key URI

@param string $type OTP type
@param string $secret Base32 encoded secret
@param string $account Account name
@param string $issuer Issuer name (optional)
@param int $counter Counter for HOTP (optional)
@param string $algorithm Algorithm name (optional)
@param string $digits Number of digits for code (optional)
@param string $period Period for TOTP codes (optional)

@return string OTP key URI
Generate OTP key URI