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

20 lines
671 B
JavaScript
Raw Normal View History

2021-06-17 01:08:50 -04:00
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)}`);
};