Python字符串转数字 import binascii s = 'test123456test' str_16 = binascii.b2a_hex(s.encode('utf-8')) # 字符串转16进制 print(str_16) def baseN(num, b): return ((num == 0) and 0) or \ (baseN(num // b, b).lstrip(0) + 0123456789abcdefghijklmnopqrstuvwxyz[num % b]) num_10 = int(str_16,