-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2aff664
commit db843fb
Showing
15 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import sympy | ||
|
||
p = 447685307 | ||
q = 2037 | ||
e = 17 | ||
|
||
N = p * q | ||
phi_N = (p - 1) * (q - 1) | ||
|
||
d = sympy.mod_inverse(e, phi_N) | ||
|
||
print("私钥D =", d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# i_kei | ||
# 2021/1/10 14:02 | ||
|
||
import re | ||
|
||
string = 'i was always Fond of visiting new scenes, and observing strange characters and manners. even when a mere chiLd i began my travels, and made mAny tours of discovery into foreiGn {parts and unknown regions of my native City, to the frequent alarm of my parents, and The emolument of the town-crier. as i grew into boyhood, i extended the range oF my obServations. my holiday afternoons were spent in rambles about tHe surrounding cOuntry. i made myself familiar With all its places famous in history or fable. i kNew every spot where a murder or robbery had been committed, or a ghost seen. i visited the neighboring villages, and added greatly to my stock of knowledge,By noting their habits and customs, and conversing with their sages and great men.}' | ||
|
||
result = ''.join(re.findall(r'[A-Z\{\}]',string)) | ||
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
def bur_sre(arr): | ||
n=len(arr) | ||
for i in range(n-1): | ||
for j in range(0,n-i-1): | ||
if arr[j]>arr[j+1]: | ||
arr[j],arr[j+1]=arr[j+1],arr[j] | ||
arr=[64,34,25,12,22,11,90] | ||
bur_sre(arr) | ||
print('冒泡排序',arr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def quick_1(arr): | ||
if len(arr)<=1: | ||
return arr | ||
else: | ||
pivot=arr[0] | ||
less=[x for x in arr[1:]if x<=pivot] | ||
greater=[x for x in arr[1:]if x>pivot] | ||
return quick_1(less)+[pivot]+quick_1(greater) | ||
arr=[55,25,13,23,13] | ||
sorted_arr=quick_1(arr) | ||
print("快速排序",sorted_arr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
with open('bits_on_wire.txt', 'r') as r: | ||
bits = r.read() | ||
bins = '' # 存放转换后的bins | ||
for i in range(len(bits)): | ||
|
||
if bits[0:2] == '10': | ||
bins += '1' | ||
else: | ||
bins += '0' | ||
bits = bits[2:] | ||
print(bins) | ||
print(len(bins)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def sel_1(arr): | ||
n=len(arr) | ||
for i in range(n): | ||
min_index=1 | ||
for j in range(i+1,n): | ||
if arr[j]<arr[min_index]: | ||
min_index=j | ||
arr[i],arr[min_index]=arr[min_index],arr[i] | ||
arr=[64,25,12,22,11] | ||
sel_1(arr) | ||
print('选择排序',arr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from PIL import Image | ||
MAX = 25 | ||
#二维码大小 | ||
pic = Image.new("RGB",(MAX, MAX)) | ||
str = """0000000001110010000000000 | ||
0000000000011110100000000 | ||
0000000001110001000000000 | ||
0000000010111100000000000 | ||
0000000010101010000000000 | ||
0000000001100010100000000 | ||
0000000010101010100000000 | ||
0000000001000001100000000 | ||
1100011101110110100011000 | ||
0001000010110010010010100 | ||
0100111101000011101110011 | ||
0011110100101011001001001 | ||
1000001001100001001101000 | ||
1111000111111011100101000 | ||
1011011111001101111110111 | ||
1000110110010010101101100 | ||
1000111100111111111110111 | ||
0000000010110001100010100 | ||
0000000010010100101010001 | ||
0000000010101010100011001 | ||
0000000000100111111110010 | ||
0000000000011001011110111 | ||
0000000001001100100100001 | ||
0000000011000011011011001 | ||
0000000011010000101110101 | ||
""" | ||
# str为获取的01片段 | ||
i=0 | ||
for y in range (0,MAX): | ||
for x in range (0,MAX): | ||
if(str[i] == '1'): | ||
pic.putpixel([x,y],(0, 0, 0)) | ||
else: | ||
pic.putpixel([x,y],(255,255,255)) | ||
i = i+1 | ||
pic.show() | ||
pic.save("1.png") | ||
#由于直接预览分辨率太低,所以保存下来观看 |