mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
update
This commit is contained in:
1 parent
8389519249
commit
a5886ecb99
37 files changed
+940
-162
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import 'hydrooj';
|
||||
|
||||
const { md5, sha1 } = global.Hydro.lib;
|
||||
|
||||
interface Udoc {
|
||||
uname: string,
|
||||
unameLower: string,
|
||||
}
|
||||
|
||||
function hash(password: string, salt: string, udoc: Udoc) {
|
||||
const { uname, unameLower } = udoc;
|
||||
const pmd5 = md5(password);
|
||||
const mixedSha1 = sha1(md5(unameLower + pmd5) + salt + sha1(pmd5 + salt));
|
||||
return `${Buffer.from(uname).toString('base64')}|${mixedSha1}`;
|
||||
}
|
||||
|
||||
global.Hydro.lib['hash.vj2'] = hash;
|
||||
Reference in new issue
Block a user