Python generating a range of numbers that have no same digits & unique
<p>i am trying to figure out how to generate a list of numbers that are not only unique but also have no similar digits
The purpose is to crack sample hashes using crypt, what i know is the passwords are unique, no repeating digits and up to 6 digits</p>

<p>Example></p>

<pre><code>[1,2,3,4,5,6,7,8,9...120, 123,124,125,126,127... 123456,123457...]
</code></pre>

<p>so 122 or 123451 or 12345673 because there will be repeating numbers</p>

<p>my code </p>

<pre><code>#!/usr/bin/env python

from os import getuid
from crypt import crypt
import time

# all initialisation here
password = range(1000000)
# all initialisation ends here

def VerifyHash(shadowHashes, salt, user):
    # crypt("Message", "Salt")
    for i in password:
        if (shadowHashes == crypt(str(i),salt)):
            print "Password of %s is " % user + str(i)
            break
        else:
            pass

def main():
    with open('shadow.txt') as p:
            for line in p:
                shadowList = line
                shadowHashes = shadowList.split(':')[1]
                user = shadowList.split(':')[0]
                salt = shadowHashes[:12]
                VerifyHash(shadowHashes,salt,user)  

main()
</code></pre>

<p>for now i am using range(1000000) and it works but is inefficient because the numbers i'm comparing to are unique with no repeating digits so i want to make my python program more efficient</p>

<p>Please point me in the right direction</p>