summaryrefslogtreecommitdiff
path: root/server/hornchat.verification.safety.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-08-10 10:38:44 +0200
committerMinteck <contact@minteck.org>2022-08-10 10:38:44 +0200
commitc6dbf0450566c40efc4a26f4f0717452b6ef95cd (patch)
treeb4be2d508223820d0a77d5a3e35e82684da3b6ec /server/hornchat.verification.safety.js
downloadhornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.tar.gz
hornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.tar.bz2
hornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.zip
Initial commitHEADmane
Diffstat (limited to 'server/hornchat.verification.safety.js')
-rw-r--r--server/hornchat.verification.safety.js14
1 files changed, 14 insertions, 0 deletions
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