【分享】兽音译者 Python实现
非原创 #兽音译者,一种将“呜嗷啊~”四个字符,voiceTxt): if(voiceTxt): voiceTxt=voiceTxt.strip() if(voiceTxt.__len__()==4): self.__animalVoice=voiceTxt return True return False def getAnimalVoice(self): return self.__animalVoice 使用方法:实例化一个HowlingAnimalsTranslator对象,txt): txt=txt.strip() if(not self.identify(txt)): return "Incorrect format!" result="" i=3 offset=0 while(itxt.__len__()-1): c=0 b=i+8 while(ib): n1=self.__animalVoice.index(txt[i]) i+=1 n2=self.__animalVoice.index(txt[i]) c=c4|((n12|n2)+offset)nbsp; if(offset==0): offset=0x10000*0x10000-1 else: offset-=1 i+=1 result+=chr(c) return result def identify(self,https://greasyfork.org/en/scripts/36842-google-select-text-translator#该插件经设置后,可下载油猴插件Google selected text translator,一种新的咆哮体加密算法,也可生成兽音密文class HowlingAnimalsTranslator: __animalVoice="嗷呜啊~" def __init__(self, 搜集的兽音译者 python实现代码在此分享,txt=""): txt=txt.strip() if(txt.__len__()1): return "" result=self.__animalVoice[3]+self.__animalVoice[1]+self.__animalVoice[0] offset=0 for t in txt: c=ord(t) b=12 while(b=0): hex=(cb)+offsetnbsp; offset+=1 result+=self.__animalVoice[int(hex2)] result+=self.__animalVoice[int(hexnbsp; b-=4 result+=self.__animalVoice[2] return result def deConvert(self,newAnimalVoice=None): self.setAnimalVoice(newAnimalVoice) def convert(self,#另,调用convert()与deConvert()方法即可进行兽语的加密与解密 ,进行加密,将明文进行重新组合的加密算法,txt): if(txt): txt=txt.strip() if(txt.__len__()11): if(txt[0]==self.__animalVoice[3] and txt[1]==self.__animalVoice[1] and txt[2]==self.__animalVoice[0] and txt[-1]==self.__animalVoice[2] and ((txt.__len__()-4)%8)==0): for t in txt: if(not self.__animalVoice.__contains__(t)): return False return True return False def setAnimalVoice(self,不仅可以划词翻译兽音密文,还可以将四个字符任意换成其它的字符,通过特殊算法,。
- 上一篇:怎么用迅雷批量下载任务
- 下一篇:涨棋网 App
评论列表