コード例 #1
0
ファイル: misc.py プロジェクト: i1470s/IVRY-Discord-Bot
    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'))
        )
コード例 #2
0
ファイル: misc.py プロジェクト: i1470s/IVRY-Discord-Bot
    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'))
        )
コード例 #3
0
ファイル: misc.py プロジェクト: i1470s/IVRY-Discord-Bot
    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'))
        )
コード例 #4
0
ファイル: encryption.py プロジェクト: zeromomentum121/FooBot
    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'))
        )
コード例 #5
0
ファイル: misc.py プロジェクト: i1470s/IVRY-Discord-Bot
    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...")
コード例 #6
0
ファイル: misc.py プロジェクト: i1470s/IVRY-Discord-Bot
    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...")
コード例 #7
0
ファイル: misc.py プロジェクト: i1470s/IVRY-Discord-Bot
    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...")
コード例 #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'))
        )
コード例 #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...")
コード例 #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'))
        )
コード例 #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...")
コード例 #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'))
        )
コード例 #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...")
コード例 #14
0
ファイル: encryption.py プロジェクト: zeromomentum121/FooBot
    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...")
コード例 #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")))
コード例 #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...")
コード例 #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)  
コード例 #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")))
コード例 #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')))
コード例 #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'))
     )
コード例 #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'))
     )
コード例 #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'))
     )