trustelem / zxcvbn

Go implementation of Dropbox's zxcvbn realistic password strength estimator
MIT License
67 stars 13 forks source link

Repetition matcher fails with special UTF-8 characters #17

Open zekroTJA opened 1 year ago

zekroTJA commented 1 year ago

It seems like the repetition matcher fails to identify repetitions when composed of special UTF-8 characters like ü, for example.

Here is an example code snippet demonstrating the issue.

package main

import (
    "fmt"

    "github.com/trustelem/zxcvbn"
)

func main() {
    res := zxcvbn.PasswordStrength("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil)
    fmt.Println(res.Guesses)

    res = zxcvbn.PasswordStrength("ööööööööööööööööööööööööööööööööööööö", nil)
    fmt.Println(res.Guesses)

    res = zxcvbn.PasswordStrength("øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø", nil)
    fmt.Println(res.Guesses)
}

Demo: https://go.dev/play/p/bDyahn5GnEU