I'm trying to do a bruteforce string generator in Python and itertools.combinations_with_replacement
seemed to do just the trick.
gen = itertools.combinations_with_replacement('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',12)
for combination in gen:
check(''.join(combination))
Say the user runs the program for some hours and reaches up to string aaaeabdouzIU
.
Is there any way given a string where they left off to start making combinations from that point onwards?
So if I pass the string 'acc
' it should start trying 'acd
','ace
',...
itertools.combinations_with_replacement
does not provide this natively, is there any way someone could achive this?