$lastStep && $found === null) $found = $step; } return $found; } /** * 認証アプリに登録するURI(QRコードにする) * * @param string $account ユーザー名等 * @param string $issuer サイトの名前 */ public static function uri(#[\SensitiveParameter] string $secret, string $account, string $issuer): string { $label = rawurlencode($issuer).':'.rawurlencode($account); return 'otpauth://totp/'.$label.'?secret='.rtrim($secret, '=').'&issuer='.rawurlencode($issuer).'&algorithm=SHA1&digits='.self::DIGITS.'&period='.self::PERIOD; } }