From c6dbf0450566c40efc4a26f4f0717452b6ef95cd Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 10 Aug 2022 10:38:44 +0200 Subject: Initial commit --- server/hornchat.verification.safety.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 server/hornchat.verification.safety.js (limited to 'server/hornchat.verification.safety.js') diff --git a/server/hornchat.verification.safety.js b/server/hornchat.verification.safety.js new file mode 100644 index 0000000..59ba8bd --- /dev/null +++ b/server/hornchat.verification.safety.js @@ -0,0 +1,14 @@ +module.exports = (username) => { + let hex = require('crypto').createHash("sha256").update(Object.keys(keys[username]).map((i) => { + return keys[username][i]; + }).map((i) => { + return JSON.stringify(i); + }).join("|")).digest("hex"); + + return { + raw: hex, + user: BigInt("0x" + hex).toString().substring(0, 60), + parts: BigInt("0x" + hex).toString().substring(0, 60).match(/.{1,5}/g), + colors: hex.substring(0, 36).match(/.{1,6}/g) + }; +} \ No newline at end of file -- cgit