赞
踩
十六进制解码转化字符代码如下:
- #十六进制解码转化字符代码如下
- str='253464253534253435253335253433253661253435253737253464253531253666253738253464253434253637253462253466253534253662253462253464253534253435253738253433253661253435253737253466253531253666253738253464253434253435253462253464253534253435253332253433253661253435253738253464253531253666253738253464253534253535253462253464253534253431253330253433253661253435253737253465253531253666253738253464253661253435253462253466253534253633253462253464253534253435253737253433253661253662253334253433253661253662253333253433253661253435253738253465253431253364253364'
- def HexDe(str):
- decstr = ''
- #i+=4
- for i in range(0,len(str),2):
- decstr +=chr(int(str[i:i + 2],16))#unichr()跟chr()一样,只不过返回的是Unicode字符
- return decstr
- print(HexDe(str))
4.利用Base64代码得到:
- #-*- coding: utf-8
- import base64
-
- str=b'MTE5CjEwMQoxMDgKOTkKMTExCjEwOQoxMDEKMTE2CjExMQoxMTUKMTA0CjEwNQoxMjEKOTcKMTEwCjk4Cjk3CjExNA=='
- str=base64.b64decode(str)
- print(str)
- str=str.decode('ascii')#bytes解码会得到str
- print(str)
5.利用Ascii代码得到welcometoshiyanbar
- #从数字转换到字母 按照ASCII编码
- L=[119,101,108,99,111,109,101,116,111,115,104,105,121,97,110,98,97,114]
-
- for x in L:
- print(chr(x),end='')
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。