Expire0 / expire0-passwordApp

Password manager application
https://expire0.dev
3 stars 11 forks source link

Password Generator Added #2

Closed ayushmankumar7 closed 5 years ago

carlzoo commented 5 years ago

This is not safe for security usage.

ayushmankumar7 commented 5 years ago

Okay. Lemme See what i can do

Expire0 commented 5 years ago

there are some errors in the code under Python3 . Maybe you need to iterate through the dict? 260 except ValueError: 261 raise IndexError('Cannot choose from an empty sequence') from None --> 262 return seq[i] 263 264 def shuffle(self, x, random=None):

TypeError: 'dict_keys' object is not subscriptable

Expire0 commented 5 years ago

Okay. Lemme See what i can do

based of your intial code . consider this as it seem to work with Python3 def generate_pass(length=21): """Function to generate a password"""

password = []

while len(password) < length:
    key = choice([char_set["small"],char_set["big"],char_set["special"],char_set["nums"]])
    a_char = urandom(1)
    n = choice(key)
    if n in key:
        if check_prev_char(password, n):
            continue
        else:
            password.append(n)
return ''.join(password)
ayushmankumar7 commented 5 years ago

Thanks for the help. Should i PR once again?

Expire0 commented 5 years ago

This looks good. Thank you .. approving the PR