FridayNightFunkinBoyfriendBot/modules/hashing.js

41 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-02-13 12:11:00 -05:00
// * Not real hashing
const crypto = require('crypto')
const ownerkey = process.env['FNFBoyfriendBot_Owner_key']
const key = process.env['FNFBoyfriendBot_key']
function inject(bot) {
bot.hash = ''
bot.ownerhash = ''
bot.updatehashes = update
let hash
let owner
let interval = setInterval(() => {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
bot.hash = hash
bot.ownerhash = owner
}, 2000)
function update() {
hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + key).digest('hex').substring(0, 16)
owner = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerkey).digest('hex').substring(0, 16)
bot.hash = hash
bot.ownerhash = owner
}
//this should work right?
// ok
/*
bot.on('end', () => {
if (interval) clearInterval(interval)
})
*/
}
module.exports = inject
/* const interval = setInterval(() => {
const normalKey = process.env['chomensjs_key']
const ownerHashKey = process.env['chomensjs_owner_key']
bot.hash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + normalKey).digest('hex').substring(0, 16)
bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + ownerHashKey).digest('hex').substring(0, 16)
}, 2000)
bot.on('end', () => {
clearInterval(interval)
*/