diff options
author | Minteck <contact@minteck.org> | 2022-08-10 10:38:44 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-08-10 10:38:44 +0200 |
commit | c6dbf0450566c40efc4a26f4f0717452b6ef95cd (patch) | |
tree | b4be2d508223820d0a77d5a3e35e82684da3b6ec /server/hornchat.verification.safety.js | |
download | hornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.tar.gz hornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.tar.bz2 hornchat-c6dbf0450566c40efc4a26f4f0717452b6ef95cd.zip |
Diffstat (limited to 'server/hornchat.verification.safety.js')
-rw-r--r-- | server/hornchat.verification.safety.js | 14 |
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 |