python: Fix s and x patterns
This commit is contained in:
@ -77,17 +77,20 @@ class Passgeny:
|
||||
|
||||
def gen_special(match):
|
||||
slen = 1 if match[1] == "" else int(match[1])
|
||||
return PASSGENY_SPECIAL[bh.modulo(len(PASSGENY_SPECIAL))]
|
||||
s = ""
|
||||
for l in range(slen):
|
||||
s += PASSGENY_SPECIAL[bh.modulo(len(PASSGENY_SPECIAL))]
|
||||
return s
|
||||
|
||||
def gen_decimal(match):
|
||||
dlen = 1 if match[1] == "" else int(match[1])
|
||||
return "{}".format(bh.modulo(dlen))
|
||||
|
||||
def gen_hexstr(match):
|
||||
xlen = 1 if match[1] == "" else int(match[1])
|
||||
x = ""
|
||||
for l in range(int(match[1])):
|
||||
for l in range(xlen):
|
||||
x += "{:x}".format(bh.modulo(16))
|
||||
|
||||
return x
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user