chore: attempt to inject our french dictionnary to new zxcvbn lib

Co-Authored-By: Lisa Durand <lisa.c.durand@gmail.com>
This commit is contained in:
Colin Darie 2024-09-11 16:32:35 +02:00 committed by Lisa Durand
parent 030bfa6651
commit 3a3993f2e1
No known key found for this signature in database
GPG key ID: 0DF91F2CA1E8B816
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
path = Rails.root.join("config/words_fr_frequency_list.txt")
lines = path.readlines.map(&:strip)
filename = File.basename(path, ".*")
new_ranked_dictionary = Hash[filename, Zxcvbn::Matching.build_ranked_dict(lines)]
# Zxcvbn::Matching::RANKED_DICTIONARIES.merge! new_ranked_dictionary
Zxcvbn::Matching::RANKED_DICTIONARIES = new_ranked_dictionary

View file

@ -0,0 +1,4 @@
password
00000000
test
azerty