Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional option to perform matching and scoring with unicode support #16

Open
techgaun opened this issue Apr 4, 2019 · 5 comments
Open

Comments

@techgaun
Copy link
Owner

techgaun commented Apr 4, 2019

No description provided.

@axelson
Copy link
Contributor

axelson commented Apr 6, 2019

Is it expected for ZXCVBN to raise an exception if provided a non-unicode string until this option is implemented?

Currently I see:

  test "unicode support" do
    password = "🏆🔥 and words"
    ZXCVBN.zxcvbn(password)
  end

     ** (UnicodeConversionError) incomplete encoding starting at <<240, 159>>
     code: ZXCVBN.zxcvbn(password)
     stacktrace:
       (elixir) lib/string.ex:2157: String.to_charlist/1
       (zxcvbn) lib/zxcvbn/matching.ex:565: anonymous fn/4 in ZXCVBN.Matching.do_sequence_match/2
       (elixir) lib/enum.ex:3003: Enum.reduce_range_inc/4
       (zxcvbn) lib/zxcvbn/matching.ex:561: ZXCVBN.Matching.do_sequence_match/2
       (elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
       (elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
       (zxcvbn) lib/zxcvbn/matching.ex:101: ZXCVBN.Matching.omnimatch/2
       (zxcvbn) lib/zxcvbn.ex:92: ZXCVBN.zxcvbn/2
       test/zxcvbn_test.exs:44: (test)

This test is with emoji but I believe it holds for foreign language characters as well.

@techgaun
Copy link
Owner Author

techgaun commented Apr 6, 2019

@axelson yep that's a known issue and is happening because it handles ASCII only at this time. I am working on getting support for this. I believe non-ASII passwords are used by very less percentage of people given the lack of support on various different platforms.

@axelson
Copy link
Contributor

axelson commented Sep 2, 2019

@techgaun any progress on this?

@techgaun
Copy link
Owner Author

techgaun commented Sep 2, 2019

@axelson I've added some support for this on master branch but need some time to do testing. Feel free to give master branch a try and see if that works in your case. I do need to spend some time to clean that up but I've not been finding time due to job and personal reasons for last few months.

@axelson
Copy link
Contributor

axelson commented Sep 2, 2019

Okay, I'll take a look at the version in master when I get a chance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants