Update qrt.
This commit is contained in:
parent
38f3622525
commit
98e4209e39
3 changed files with 2 additions and 2 deletions
|
@ -305,7 +305,7 @@ def generate_image(string, debug=False):
|
||||||
draw_triangle(im, points, cell, size)
|
draw_triangle(im, points, cell, size)
|
||||||
return im
|
return im
|
||||||
|
|
||||||
FLAG = "are_triangles_more_secure_than_squares?_%s}"
|
FLAG = "are_triangles_more_secure_than_squares?_%s"
|
||||||
|
|
||||||
def get_salt(random):
|
def get_salt(random):
|
||||||
salt = "".join([random.choice("0123456789abcdef") for i in range(8)])
|
salt = "".join([random.choice("0123456789abcdef") for i in range(8)])
|
||||||
|
|
|
@ -36,7 +36,7 @@ def getspace(size):
|
||||||
def generate(string, debug=False):
|
def generate(string, debug=False):
|
||||||
size = 0
|
size = 0
|
||||||
binstring = bin(int(string.encode("hex"), 16)).strip("0b")
|
binstring = bin(int(string.encode("hex"), 16)).strip("0b")
|
||||||
while size < 2 or getspace(size + 1) < len(binstring):
|
while size < 3 or getspace(size + 1) - 8 < len(binstring):
|
||||||
size += 1
|
size += 1
|
||||||
n = getspace(size)
|
n = getspace(size)
|
||||||
# print size, len(binstring)
|
# print size, len(binstring)
|
||||||
|
|
BIN
qrt/qrt.pyc
BIN
qrt/qrt.pyc
Binary file not shown.
Loading…
Reference in a new issue