Skip to content

Commit 15dcc01

Browse files
committed
:octocat:
1 parent 4be0a80 commit 15dcc01

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/svg.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
],
4141
// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient
4242
'svgDefs' => '
43-
<linearGradient id="rainbow" x1="100%" y2="100%">
44-
<stop stop-color="#e2453c" offset="2.5%"/>
45-
<stop stop-color="#e07e39" offset="21.5%"/>
46-
<stop stop-color="#e5d667" offset="40.5%"/>
47-
<stop stop-color="#51b95b" offset="59.5%"/>
48-
<stop stop-color="#1e72b7" offset="78.5%"/>
49-
<stop stop-color="#6f5ba7" offset="97.5%"/>
43+
<linearGradient id="rainbow" x1="1" y2="1">
44+
<stop stop-color="#e2453c" offset="0"/>
45+
<stop stop-color="#e07e39" offset="0.2"/>
46+
<stop stop-color="#e5d667" offset="0.4"/>
47+
<stop stop-color="#51b95b" offset="0.6"/>
48+
<stop stop-color="#1e72b7" offset="0.8"/>
49+
<stop stop-color="#6f5ba7" offset="1"/>
5050
</linearGradient>
5151
<style><![CDATA[
5252
.dark{fill: url(#rainbow);}

src/Data/Number.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

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

15-
use function array_flip, ceil, ord, str_split, substr;
15+
use function array_flip, ceil, str_split, substr, unpack;
1616

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

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

107107
return $num;

0 commit comments

Comments
 (0)