mirror of
https://github.com/ihmily/DouyinLiveRecorder.git
synced 2025-12-25 21:36:46 +08:00
feat: add laixiu sign js (#1195)
This commit is contained in:
parent
3965487746
commit
e9f2a55ceb
33
src/javascript/laixiu.js
Normal file
33
src/javascript/laixiu.js
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
function generateUUID() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
const r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
function calculateSign() {
|
||||
const a = new Date().getTime();
|
||||
const s = generateUUID().replace(/-/g, "");
|
||||
const u = 'kk792f28d6ff1f34ec702c08626d454b39pro';
|
||||
|
||||
const input = "web" + s + a + u;
|
||||
|
||||
const hash = CryptoJS.MD5(input).toString();
|
||||
|
||||
return {
|
||||
timestamp: a,
|
||||
imei: s,
|
||||
requestId: hash,
|
||||
inputString: input
|
||||
};
|
||||
}
|
||||
|
||||
function sign(cryptoJSPath) {
|
||||
CryptoJS = require(cryptoJSPath);
|
||||
return calculateSign();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
sign
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user