Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Thanks for your awesome streams, they are very informativ and good understandeble(Im 15). Pls keep it up.
- msg_encode = "10101011101000110100011101111111011111110111010010110010011100101111001011001001101110011010001110111111101001011110100111011110110010110010011101010111101100111110101111101111011110111101110111111100101100100101100100111011001110010110010011010001110110011110110100101100100110111001110010111"
- tree = {
- "1" : '1',
- "2" : '01',
- "3" : '001',
- "0" : '000'
- }
- #mog = ["0", "10", "110" , "111"]
- #mog = ["1", "01", "001", "000"]
- mog = ["0", "11", "101", "100"]
- #mog = ["1", "00", "010", "011"]
- def encode_to_q(tree):
- l = ""
- global msg_encode
- en = ""
- p = 0;
- z = 0
- for i in range(0, len(msg_encode) + 1):
- if tree["1"] == msg_encode[p:i]:
- en += "1"
- p = i
- if tree["2"] == msg_encode[p:i]:
- en += "2"
- p = i
- if tree["3"] == msg_encode[p:i]:
- en += "3"
- p = i
- if tree["0"] == msg_encode[p:i]:
- en += "0"
- p = i
- print en
- s = 0
- for i in range(len(en) - 1, -1, -1):
- z += pow(4, s) * int(en[i])
- s += 1
- p = str(hex(z))
- p = p.replace("0x", "")
- p = p.replace("L", "")
- try:
- print p.decode("hex")[::-1]
- except:
- pass
- return
- def all_perms():
- lc = 0
- global tree
- global mog
- for p in range(4):
- for o in range(4):
- for l in range(4):
- for g in range(4):
- if (p != o and l != g and l != p and g != p and g != p and p != l and o != l and o != g):
- tree["1"] = mog[p]
- tree["2"] = mog[o]
- tree["3"] = mog[l]
- tree["0"] = mog[g]
- encode_to_q(tree)
- all_perms()
Advertisement
Add Comment
Please, Sign In to add comment