摘要:
#coding:utf-8 import math def str_bin(string): a = '' for i in string: f = bin(ord(i))[2:] f = '0'*(8-len(f)) + f a += f return a def Little_Endian(s, 阅读全文
摘要:
#coding:utf-8 s = '10001010'#本源多项式x^8+x^4+x^3+x^2+1 a = s ls = len(s) for i in range(0,100000): s += str(int(s[i])^int(s[i+ls-4])^int(s[i+ls-3])^int(s 阅读全文
摘要:
#coding:utf=8 from libnum import * from random import * def Miller_Rabin(n): if n == 2 or n == 3: return True if n & 1 == 0: return False s , d = 0 , 阅读全文
摘要:
#coding:utf-8 from libnum import * import base64 def stob(string): res = '' for i in string: f = bin(ord(i))[2:] f = '0'*(8-len(f)) + f res += f retur 阅读全文