Closed jesse-c closed 2 years ago
Thanks for the pull request !
I'll try to review this when I find a moment. Just a suggestion for now : it would be nice to add / export some constants so that a user of this package could easily translate messages / suggestions
No worries! :)
That's a good idea @vanackere.
Implementation wise, what were you thinking re: the constants? Another approach could be to use https://godoc.org/golang.org/x/text and people could create PRs to add translations into this project? There could then be zxcvbn.PasswordStrength()
which defaults to English, and then zxcvbn.PasswordStrengthWithLanguage()
which allows you to pass an extra arg for the language? I'm not terribly experienced with i18n though, so there's probably a better way.
I've made a faithful re-implementation for
feedback.coffee
in Go. There are tests failing because the guesses values (and therefor guesses log 10 values) don't match.The guesses log 10 value is used in calculating the feedback rule of "This is similar to a commonly used password", which is why this expectation is failing in the tests.
I wanted to open this PR now to get some feedback on the feedback and see if there were any suggestions on the incorrect guesses values.