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
def bin_8bit(dec): | |
return(str(format(dec,'08b'))) | |
def bin_32bit(dec): | |
return(str(format(dec,'032b'))) | |
def bin_4bit(dec): | |
return(str(format(dec,'04b'))) | |
def bin_64bit(dec): |
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
def to_print(object): | |
for i in range(len(object)): | |
print(object[i]) | |
def bin_n_bit(dec,n): | |
return(str(format(dec,'0'+n+'b'))) | |
def bin_8bit(dec): | |
return(str(format(dec,'08b'))) |
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
#forward_build | |
set_0=['00000','00101','01011','01010', | |
'10110','10111','10001','10100', | |
'01101','01000','01110','01111', | |
'00011','00010','01100','01001', | |
'11010','11101','10011','10000', | |
'11100','11111','11001','11110', | |
'00110','00001','00111','00100', | |
'11000','11011','10101','10010'] |
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
def bin_n_bit(dec,n): | |
return(str(format(dec,'0'+n+'b'))) | |
def hex_n_bit(dec,n): | |
return(str(format(dec,'0'+n+'x'))) | |
def xo_set(ip_0,ip_1): | |
to_return=[] | |
for i in range(len(ip_0)): | |
to_return.append(ip_0[i] ^ ip_1[i]) |
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
def bin_theta(ip): | |
c_xz=[] | |
for i in range(5): | |
c_xz.append(ip[i] ^ ip[i+5] ^ ip[i+10] ^ ip[i+15] ^ ip[i+20]) | |
d_xz=[] | |
for i in range(5): | |
d_xz.append(c_xz[(i-1)%5] ^ rot(c_xz[(i+1)%5],1,64)) | |
for i in range(5): | |
ip[i] = ip[i] ^ d_xz[i] | |
ip[i+5] = ip[i+5] ^ d_xz[i] |
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
from Tkinter import * | |
import csv | |
import win32clipboard | |
import os | |
def bat_exe(): | |
''' | |
Note that both methods will execute a batch file from your home directory. | |
''' | |
#os.system("F:/Anaconda3/pdm_open.bat") |
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
def conversion(str_list): | |
for i in range(len(str_list)): | |
str_list[i]=int(str_list[i]) | |
return(str_list) | |
def trim_end(a_string): | |
return(a_string[0:len(a_string)-1]) | |
def dec_shift(a_string): | |
to_build_0='' |
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
#https://gist.github.com/back-seat-driver/b2f81929741cd94b1ff17086fdaad0bd | |
def bin_n_bit(dec,n): | |
return(str(format(dec,'0'+n+'b'))) | |
def hex_n_bit(dec,n): | |
return(str(format(dec,'0'+n+'x'))) | |
def xo_set(ip_0,ip_1): | |
to_return=[] |
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
def to_print(object): | |
for i in range(len(object)): | |
print(object[i]) | |
def l_s(bit_list): | |
bit_string='' | |
for i in range(len(bit_list)): | |
bit_string+=bit_list[i] | |
return(bit_string) |
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
from PIL import Image | |
import numpy as np | |
import hashlib | |
import scipy.misc | |
def S_L(string_name_list,LIST): | |
f = open(string_name_list + '.py', 'w') | |
simplejson.dump(LIST,f) | |
f.close() |
NewerOlder