Toggle navigation
Toggle navigation
This project
Loading...
Sign in
201side
/
floater
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
robin*
2020-12-10 10:23:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2de70baff8d7fffe415162ed6e83f76b961af6cb
2de70baf
1 parent
7455246b
id와 ip 기반 해시 함수 제작
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
src/hash.js
src/hash.js
0 → 100644
View file @
2de70ba
1
+
const
crypto
=
require
(
'crypto'
);
2
+
3
+
module
.
exports
=
function
(
id
,
ip
)
{
4
+
let
hash
=
crypto
.
createHmac
(
'sha256'
,
`
${
id
}${
ip
}
sytgsalt`
);
5
+
return
hash
.
digest
(
'base64'
).
slice
(
0
,
8
);
6
+
};
...
\ No newline at end of file
...
\ No newline at end of file
Please
register
or
login
to post a comment