Skip to content

Levenshtein? #182

Answered by MrWook
jiblett1000 asked this question in Q&A
Mar 16, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Seems reasonable and i will add it to the docs.

The levenshtein implementation compares two strings with each other and gives a the number of differences back. For example
password vs passwrd. With this example we got a levenshtein distance of 1 which basically means there is a difference of 1 character between both string.
This is not limited to missing characters. It also checks for additional or different characters like passwword or passworf.

In the context of zxcvbn it will improve the algorithm too find entries in a dictionary as it not only tries to find equals matches like password === password but also string with a difference of 2, in the default configuration.
This means with t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jiblett1000
Comment options

Answer selected by jiblett1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants