From e6b79a58384787c1607ff35bdaca9dc0e2d06db4 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Mon, 13 Nov 2023 21:36:04 +0100 Subject: [PATCH] Create global function file --- src/_data/global.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/_data/global.js diff --git a/src/_data/global.js b/src/_data/global.js new file mode 100644 index 0000000..a2c10f4 --- /dev/null +++ b/src/_data/global.js @@ -0,0 +1,8 @@ +module.exports = { + random() { + const segment = () => { + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); + }; + return `${segment()}-${segment()}-${segment()}`; + } +}; \ No newline at end of file