Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
fa93d68b
Commit
fa93d68b
authored
May 20, 2017
by
neilpang
Browse files
promote performance
parent
b420ec6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
fa93d68b
#!/usr/bin/env sh
#!/usr/bin/env sh
VER
=
2.
6.9
VER
=
2.
7.0
PROJECT_NAME
=
"acme.sh"
PROJECT_NAME
=
"acme.sh"
...
@@ -450,31 +450,35 @@ _h2b() {
...
@@ -450,31 +450,35 @@ _h2b() {
fi
fi
hex
=
$(
cat
)
hex
=
$(
cat
)
i
=
1
i
c
=
""
j
=
2
j
c
=
""
_debug2 _URGLY_PRINTF
"
$_URGLY_PRINTF
"
_debug2 _URGLY_PRINTF
"
$_URGLY_PRINTF
"
if
[
-z
"
$_URGLY_PRINTF
"
]
;
then
if
[
-z
"
$_URGLY_PRINTF
"
]
;
then
while
true
;
do
if
_exists xargs
;
then
h
=
"
$(
printf
"%s"
"
$hex
"
|
cut
-c
$i
-
$j
)
"
_debug2
"xargs"
if
[
-z
"
$h
"
]
;
then
echo
"
$hex
"
|
sed
's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI'
| xargs
printf
break
else
fi
for
h
in
$(
echo
"
$hex
"
|
sed
's/\([0-9A-F]\{2\}\)/ \1/gI'
)
printf
"
\x
$h
%s"
do
i
=
"
$(
_math
"
$i
"
+ 2
)
"
if
[
-z
"
$h
"
]
;
then
j
=
"
$(
_math
"
$j
"
+ 2
)
"
break
done
fi
printf
"
\x
$h
%s"
done
fi
else
else
while
true
;
do
for
c
in
$(
echo
"
$hex
"
|
sed
's/\([0-9A-F]\)/ \1/gI'
)
ic
=
"
$(
printf
"%s"
"
$hex
"
|
cut
-c
$i
)
"
do
jc
=
"
$(
printf
"%s"
"
$hex
"
|
cut
-c
$j
)
"
if
[
-z
"
$ic
"
]
;
then
if
[
-z
"
$ic$jc
"
]
;
then
ic
=
$c
break
continue
fi
fi
jc
=
$c
ic
=
"
$(
_h_char_2_dec
"
$ic
"
)
"
ic
=
"
$(
_h_char_2_dec
"
$ic
"
)
"
jc
=
"
$(
_h_char_2_dec
"
$jc
"
)
"
jc
=
"
$(
_h_char_2_dec
"
$jc
"
)
"
printf
'\'
"
$(
printf
"%o"
"
$(
_math
"
$ic
"
\*
16 +
$jc
)
"
)
""%s"
printf
'\'
"
$(
printf
"%o"
"
$(
_math
"
$ic
"
\*
16 +
$jc
)
"
)
""%s"
i
=
"
$(
_math
"
$i
"
+ 2
)
"
i
c
=
""
j
=
"
$(
_math
"
$j
"
+ 2
)
"
j
c
=
""
done
done
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment