MCPcopy Create free account
hub / github.com/cmliu/WorkerVless2sub / MD5MD5

Function MD5MD5

_worker.js:327–339  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

325}
326
327async function MD5MD5(text) {
328 const encoder = new TextEncoder();
329
330 const firstPass = await crypto.subtle.digest('MD5', encoder.encode(text));
331 const firstPassArray = Array.from(new Uint8Array(firstPass));
332 const firstHex = firstPassArray.map(b => b.toString(16).padStart(2, '0')).join('');
333
334 const secondPass = await crypto.subtle.digest('MD5', encoder.encode(firstHex.slice(7, 27)));
335 const secondPassArray = Array.from(new Uint8Array(secondPass));
336 const secondHex = secondPassArray.map(b => b.toString(16).padStart(2, '0')).join('');
337
338 return secondHex.toLowerCase();
339}
340
341function revertFakeInfo(content, userID, hostName) {
342 content = content.replace(new RegExp(fakeUserID, 'g'), userID).replace(new RegExp(fakeHostName, 'g'), hostName);

Callers 1

fetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected