Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PHP
support
Commits
17deec30
Commit
17deec30
authored
6 years ago
by
康帅杰
Browse files
Options
Download
Email Patches
Plain Diff
sign function
parent
3cf61eb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Sign.php
+6
-5
src/Sign.php
with
6 additions
and
5 deletions
+6
-5
src/Sign.php
View file @
17deec30
<?php
<?php
namespace
Yjtec\Support
;
class
Sign
{
public
static
function
make
(
$secret
,
$timeStamp
,
$params
,
$debug
=
false
){
public
static
function
make
(
$secret
,
$timeStamp
,
$params
,
$debug
=
false
)
{
ksort
(
$params
);
$paramstr
=
''
;
foreach
(
$params
as
$k
=>
$v
)
{
$paramstr
.
=
"
{
$k
}{
$v
}
"
;
}
$str
=
"
{
$secret
}
-
{
$paramstr
}
-
{
$timeStamp
}
"
;
$str
=
"
{
$secret
}
-
{
$paramstr
}
-
{
$timeStamp
}
"
;
$re
[
'sign'
]
=
md5
(
$str
);
if
(
$debug
){
if
(
$debug
)
{
$re
[
'paramstr'
]
=
$str
;
}
return
$re
;
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help