Skip to content

Repetition matcher fails with special UTF-8 characters #17

Open
@zekroTJA

Description

@zekroTJA

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions