Server IP : 51.89.169.208 / Your IP : 18.222.93.141 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/src/QRCode/ |
Upload File : |
<?php namespace PragmaRX\Google2FAQRCode\QRCode; use Illuminate\Support\Str; use chillerlan\QRCode\QRCode; use chillerlan\QRCode\QROptions; use BaconQrCode\Writer as BaconQrCodeWriter; class Chillerlan implements QRCodeServiceContract { protected $options = []; /** * Get QRCode options. * * @param int $size * @return \chillerlan\QRCode\QROptions */ protected function getOptions() { $options = new QROptions($this->buildOptionsArray()); return $options; } /** * Set QRCode options. * * @param array $options * @return self */ protected function setOptions($options) { $this->options = $options; return $this; } /** * Build the options array * * @param null $size * @return array */ public function buildOptionsArray($size = null) { $defaults = [ 'version' => QRCode::VERSION_AUTO, 'outputType' => QRCode::OUTPUT_MARKUP_SVG, 'eccLevel' => QRCode::ECC_L, ]; return array_merge($defaults, $this->options); } /** * Generates a QR code data url to display inline. * * @param string $string * @param int $size * @param string $encoding Default to UTF-8 * * @return string */ public function getQRCodeInline($string, $size = null, $encoding = null) { $renderer = new QRCode($this->getOptions()); $header = "data:image/svg+xml;base64,"; $image = $renderer->render($string); if (strncmp($image, $header, strlen($header)) === 0) { return $image; } return $header . base64_encode($image); } }