mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
hash util function
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const crypto = require('crypto');
|
||||
const { hash } = require('../../util/Util');
|
||||
|
||||
module.exports = class MD5Command extends Command {
|
||||
constructor(client) {
|
||||
@@ -20,6 +20,6 @@ module.exports = class MD5Command extends Command {
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.say(crypto.createHash('md5').update(text).digest('hex'));
|
||||
return msg.say(hash(text, 'md5'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const crypto = require('crypto');
|
||||
const { hash } = require('../../util/Util');
|
||||
|
||||
module.exports = class SHA256Command extends Command {
|
||||
constructor(client) {
|
||||
@@ -20,6 +20,6 @@ module.exports = class SHA256Command extends Command {
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.say(crypto.createHash('sha256').update(text).digest('hex'));
|
||||
return msg.say(hash(text, 'sha256'));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user