Exemplo n.º 1
0
    async def encode_hex(self, ctx, *, input: commands.clean_content = None):
        if not input:
            input = await self.detect_file(ctx)

        await self.encryptout(
            ctx, "Text -> hex", binascii.hexlify(input.encode('UTF-8'))
        )
Exemplo n.º 2
0
    async def encode_ascii85(self, ctx, *, input: commands.clean_content = None):
        if not input:
            input = await self.detect_file(ctx)

        await self.encryptout(
            ctx, "Text -> ASCII85", base64.a85encode(input.encode('UTF-8'))
        )
Exemplo n.º 3
0
    async def encode_base32(self, ctx, *, input: commands.clean_content = None):
        if not input:
            input = await self.detect_file(ctx)

        await self.encryptout(
            ctx, "Text -> base32", base64.b32encode(input.encode('UTF-8'))
        )
Exemplo n.º 4
0
    async def encode_base64(self, ctx, *, input: commands.clean_content = None):
        """ Encode in base64 """
        if not input:
            input = await self.detect_file(ctx)

        await self.encryptout(
            ctx, "Text -> base64", base64.urlsafe_b64encode(input.encode('UTF-8'))
        )
Exemplo n.º 5
0
    async def decode_base64(self, ctx, *, input: commands.clean_content = None):
        if not input:
            input = await self.detect_file(ctx)

        try:
            await self.encryptout(ctx, "base64 -> Text", base64.urlsafe_b64decode(input.encode('UTF-8')))
        except Exception:
            await ctx.send("Invalid base64...")
Exemplo n.º 6
0
    async def decode_hex(self, ctx, *, input: commands.clean_content = None):
        if not input:
            input = await self.detect_file(ctx)

        try:
            await self.encryptout(ctx, "hex -> Text", binascii.unhexlify(input.encode('UTF-8')))
        except Exception:
            await ctx.send("Invalid hex...")
Exemplo n.º 7
0
    async def decode_ascii85(self, ctx, *, input: commands.clean_content = None):
        if not input:
            input = await self.detect_file(ctx)

        try:
            await self.encryptout(ctx, "ASCII85 -> Text", base64.a85decode(input.encode('UTF-8')))
        except Exception:
            await ctx.send("Invalid ASCII85...")
Exemplo n.º 8
0
    async def encode_base64(self, ctx, *, _input: clean_content = None):
        """ Encode in base64 """
        if not _input:
            _input = await detect_file(ctx)

        await encrypt_out(
            ctx, "Text -> base64", base64.urlsafe_b64encode(_input.encode('UTF-8'))
        )
Exemplo n.º 9
0
    async def decode_ascii85(self, ctx, *, _input: clean_content = None):
        """ Decode in ASCII85 """
        if not _input:
            _input = await detect_file(ctx)

        try:
            await encrypt_out(ctx, "ASCII85 -> Text", base64.a85decode(_input.encode('UTF-8')))
        except Exception:
            await ctx.send("Invalid ASCII85...")
Exemplo n.º 10
0
    async def encode_ascii85(self, ctx, *, _input: clean_content = None):
        """ Encode in ASCII85 """
        if not _input:
            _input = await detect_file(ctx)

        await encrypt_out(
            ctx, "Text -> ASCII85",
            base64.a85encode(_input.encode('UTF-8'))
        )
Exemplo n.º 11
0
    async def decode_hex(self, ctx, *, _input: clean_content = None):
        """ Decode in hex """
        if not _input:
            _input = await detect_file(ctx)

        try:
            await encrypt_out(ctx, "hex -> Text", binascii.unhexlify(_input.encode('UTF-8')))
        except Exception:
            await ctx.send("Invalid hex...")
Exemplo n.º 12
0
    async def encode_hex(self, ctx, *, _input: clean_content = None):
        """ Encode in hex """
        if not _input:
            _input = await detect_file(ctx)

        await encrypt_out(
            ctx, "Text -> hex",
            binascii.hexlify(_input.encode('UTF-8'))
        )
Exemplo n.º 13
0
    async def decode_base32(self, ctx, *, _input: clean_content = None):
        """ Decode in base32 """
        if not _input:
            _input = await detect_file(ctx)

        try:
            await encrypt_out(ctx, "base32 -> Text", base64.b32decode(_input.encode('UTF-8')))
        except Exception:
            await ctx.send("Invalid base32...")
Exemplo n.º 14
0
    async def decode_base85(self, ctx, *, input: commands.clean_content = None):
        """ Decode in base85 """
        if not input:
            input = await self.detect_file(ctx)

        try:
            await self.encryptout(ctx, "base85 -> Text", base64.b85decode(input.encode('UTF-8')))
        except Exception:
            await ctx.send("Invalid base85...")
Exemplo n.º 15
0
    async def encode_base85(self,
                            ctx,
                            *,
                            input: commands.clean_content = None):
        """ Encode in base85 """
        if not input:
            input = await self.detect_file(ctx)

        await self.encryptout(ctx, "Text -> base85",
                              base64.b85encode(input.encode("utf-8")))
Exemplo n.º 16
0
    async def decode_base32(self,
                            ctx,
                            *,
                            input: commands.clean_content = None):
        """ Decode in base32 """
        if not input:
            input = await self.detect_file(ctx)

        try:
            await self.encryptout(ctx, "base32 -> Text",
                                  base64.b32decode(input.encode("utf-8")))
        except Exception:
            await ctx.send("Invalid base32...")
Exemplo n.º 17
0
    async def encode_hex(self, ctx, *, input: commands.clean_content = None):
        if not input:
            e = discord.Embed(description=":no_entry_sign: You must give an input string", colour=0xE74C3C)
            await ctx.send(embed=e)
            return

        e = discord.Embed(title="Result", colour=0x2ECC71)
    
        result = (input.encode('UTF-8').hex()).decode('utf-8')
        e.add_field(name="Input", value=f"`{input}`")
        e.add_field(name="Output", value=f"`{result}`")
        e.set_footer(text="Made with ❤️ by Roxiun")

        await ctx.send(embed=e)  
Exemplo n.º 18
0
 async def encode_base32(self, ctx, *, txtinput: commands.clean_content):
     """ Encode in base32 """
     await self.encryptout(ctx, "Text -> base32",
                           base64.b32encode(txtinput.encode("UTF-8")))
Exemplo n.º 19
0
 async def encode_base64(self, ctx, *, input: commands.clean_content):
     """ Encode base64 """
     await self.encryptout(ctx, "Text -> base64",
                           base64.urlsafe_b64encode(input.encode('UTF-8')))
Exemplo n.º 20
0
 async def encode_ascii85(self, ctx, *, input: commands.clean_content):
     """ Encode in ASCII85 """
     await self.encryptout(
         ctx, "Text -> ASCII85",
         base64.a85encode(input.encode('UTF-8'))
     )
Exemplo n.º 21
0
 async def encode_hex(self, ctx, *, input: commands.clean_content):
     """ Encode in hex """
     await self.encryptout(
         ctx, "Text -> hex",
         binascii.hexlify(input.encode('UTF-8'))
     )
Exemplo n.º 22
0
 async def encode_base85(self, ctx, *, input: commands.clean_content):
     """ Encode in base85 """
     await self.encryptout(
         ctx, "Text -> base85",
         base64.b85encode(input.encode('UTF-8'))
     )