This repository has been archived on 2023-01-01. You can view files and clone it, but cannot push or open issues or pull requests.
kaboomproxy/commands/hval.js
2021-06-17 02:08:50 -03:00

20 lines
No EOL
671 B
JavaScript

const crypto = require("crypto");
const config = require("../config.js");
module.exports.exec = function(vanillaclient, client, server, args) {
const sha256 = crypto.createHash("sha256");
const command = args.join(" ");
const time = Math.floor(+new Date() / 10000);
let raw = command.replace(/&[0-9a-fklmnor]/g, "");
raw += ";";
raw += vanillaclient.username.replace(/§[0-9a-fklmnor]/g, "");
raw += ";";
raw += time;
raw += ";";
raw += config.proxy.keys.hbot;
sha256.update(raw);
const hash = sha256.digest();
const big_int = hash.slice(0, 4).readUInt32BE();
client.chat(`${command} ${big_int.toString(36)}`);
};