MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / generateUUID

Function generateUUID

wxapp/aima.js:25–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24// ================== 工具函数 ==================
25function generateUUID() {
26 return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
27 const r = (Math.random() * 16) | 0;
28 const v = c === "x" ? r : (r & 0x3) | 0x8;
29 return v.toString(16);
30 });
31}
32
33function md5(str) {
34 return crypto.createHash("md5").update(str).digest("hex");

Callers 1

buildHeadersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected