Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
constant_time_encoding
Commits
292fe138
Unverified
Commit
292fe138
authored
2 years ago
by
P.I.E. Security Team
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #40 from TimWolla/performance
Improve performance of the hex encoder
parents
e16bc4bc
1577f6e6
master
v2.6.3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Hex.php
+2
-2
src/Hex.php
with
2 additions
and
2 deletions
+2
-2
src/Hex.php
+
2
−
2
View file @
292fe138
...
...
@@ -45,7 +45,7 @@ abstract class Hex implements EncoderInterface
$len
=
Binary
::
safeStrlen
(
$binString
);
for
(
$i
=
0
;
$i
<
$len
;
++
$i
)
{
/** @var array<int, int> $chunk */
$chunk
=
\
unpack
(
'C'
,
Binary
::
safeSubstr
(
$binString
,
$i
,
1
)
);
$chunk
=
\
unpack
(
'C'
,
$binString
[
$i
]
);
$c
=
$chunk
[
1
]
&
0xf
;
$b
=
$chunk
[
1
]
>>
4
;
...
...
@@ -73,7 +73,7 @@ abstract class Hex implements EncoderInterface
for
(
$i
=
0
;
$i
<
$len
;
++
$i
)
{
/** @var array<int, int> $chunk */
$chunk
=
\
unpack
(
'C'
,
Binary
::
safeSubstr
(
$binString
,
$i
,
2
)
);
$chunk
=
\
unpack
(
'C'
,
$binString
[
$i
]
);
$c
=
$chunk
[
1
]
&
0xf
;
$b
=
$chunk
[
1
]
>>
4
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets