摘要: #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, 阅读全文
posted @ 2020-01-02 19:31 山野村夫z1 阅读(277) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2020-01-02 19:30 山野村夫z1 阅读(412) 评论(0) 推荐(0) 编辑
摘要: #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 , 阅读全文
posted @ 2020-01-02 19:22 山野村夫z1 阅读(296) 评论(0) 推荐(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 阅读全文
posted @ 2020-01-02 19:21 山野村夫z1 阅读(288) 评论(0) 推荐(0) 编辑