Design comparison
Community feedback
- @clickgluePosted 4 days ago
Hi, Great solution. The code looks clean and well organised. I can learn from your disciplined implementation of BEM. I tried to understand how you did the strength calculation, but didn't. But it works very well, congratualtions.
0@DandyHypePosted 3 days ago@clickglue Thanks for the feedback , looking back at my javascript file I must agree it's not very clear what some functions do. The way I calculate password strength is password length to the power of number of characters/symbols, I took password length of 8 as my point of reference and calculated the combination for each option.
const strengthObj = { 100000000 : ["Too Weak!" , ["bar__block-red" , 1]], 1785793904895 : ["Weak" , ["bar__block-orange", 2]], 128063081718015 : ["Medium" , ["bar__block-yellow", 3]], 2252292232139040 : ["Strong" , [ "bar__block-green", 4]], }
they keys here represent the number of combinations to beat to be at least that level of strength. Obviously the right formula should be the other way around: number of characters/symbols to the power of password length, but that was giving me ridiculously big numbers.
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord