Skip to content

Commit

Permalink
:octocat:
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Jul 9, 2023
1 parent 4be0a80 commit 15dcc01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions examples/svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
],
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient
'svgDefs' => '
<linearGradient id="rainbow" x1="100%" y2="100%">
<stop stop-color="#e2453c" offset="2.5%"/>
<stop stop-color="#e07e39" offset="21.5%"/>
<stop stop-color="#e5d667" offset="40.5%"/>
<stop stop-color="#51b95b" offset="59.5%"/>
<stop stop-color="#1e72b7" offset="78.5%"/>
<stop stop-color="#6f5ba7" offset="97.5%"/>
<linearGradient id="rainbow" x1="1" y2="1">
<stop stop-color="#e2453c" offset="0"/>
<stop stop-color="#e07e39" offset="0.2"/>
<stop stop-color="#e5d667" offset="0.4"/>
<stop stop-color="#51b95b" offset="0.6"/>
<stop stop-color="#1e72b7" offset="0.8"/>
<stop stop-color="#6f5ba7" offset="1"/>
</linearGradient>
<style><![CDATA[
.dark{fill: url(#rainbow);}
Expand Down
6 changes: 3 additions & 3 deletions src/Data/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use chillerlan\QRCode\Common\{BitBuffer, Mode};

use function array_flip, ceil, ord, str_split, substr;
use function array_flip, ceil, str_split, substr, unpack;

/**
* Numeric mode: decimal digits 0 to 9
Expand Down Expand Up @@ -100,8 +100,8 @@ public function write(BitBuffer $bitBuffer, int $versionNumber):QRDataModeInterf
private function parseInt(string $string):int{
$num = 0;

foreach(str_split($string) as $chr){
$num = ($num * 10 + ord($chr) - 48);
foreach(unpack('C*', $string) as $chr){
$num = ($num * 10 + $chr - 48);
}

return $num;
Expand Down

0 comments on commit 15dcc01

Please sign in to comment.