From b556d616b36124ce22c4452adedc2c380face475 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 19 Feb 2018 16:05:53 +0000 Subject: [PATCH] sha256 --- commands/text-edit/sha-256.js | 25 +++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 commands/text-edit/sha-256.js diff --git a/commands/text-edit/sha-256.js b/commands/text-edit/sha-256.js new file mode 100644 index 00000000..f9de9217 --- /dev/null +++ b/commands/text-edit/sha-256.js @@ -0,0 +1,25 @@ +const { Command } = require('discord.js-commando'); +const crypto = require('crypto'); + +module.exports = class SHA256Command extends Command { + constructor(client) { + super(client, { + name: 'sha-256', + aliases: ['sha-256-hash'], + group: 'text-edit', + memberName: 'sha-256', + description: 'Creates a hash of text with the SHA-256 algorithm.', + args: [ + { + key: 'text', + prompt: 'What text would you like to create an SHA-256 hash of?', + type: 'string' + } + ] + }); + } + + run(msg, { text }) { + return msg.say(crypto.createHash('sha256').update(text).digest('hex')); + } +}; diff --git a/package.json b/package.json index a8c5beac..4a5ab627 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "65.1.1", + "version": "65.2.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {