dropbox/zxcvbn

user_inputs argument

NoName115 opened this issue · 3 comments

I think that 'user_inputs' argument is not working correctly, e.g.

>>> from zxcvbn import zxcvbn
>>> zxcvbn('i love you')['score']
3
>>> zxcvbn('i love you', user_inputs=['love'])['score']
3
>>> zxcvbn('i love you', user_inputs=['love', 'you'])['score']
3
>>> zxcvbn('i love you', user_inputs=['i', 'love', 'you'])['score']
3

Yes I agree.

zxcvbn('sherlock holmes')['score']
3
zxcvbn('sherlock holmes',['sherlock', 'holmes'])['score']
3
zxcvbn('sherlock holmes',['sherlock holmes'])['score']
0

So it does work but ONLY if the password exactly matches an option in the user inputs which sort of defeats the object of passing the form fields in.

I also suspect the problem is further compounded by this issue #216.

It looks like #216 is exactly the problem here - the spaces are being integrated as part of the surrounding words, causing those words not to match the user inputs dictionary.