server
server copied to clipboard
Implementing password strength check
I removed:
minLength: number;
minNumbers: number;
minUpperCase: number
minSymbols: number
and instead implemented
strength: number;
~~Also I removed the shannon entropy calculation, I couldn't get it to work and idk math~~ entropy calculation now works thanks to @greysilly7
I am against this PR the entropy calculation has an information theoretical basis here, and it checks how much information that the password carries relative to an incompressible string (which is what we want an ideal password to be, not an unrememberable string of special characters)
I made a mistake with my wording, I didn't exactly remove it. See the "Files changed".
function calculateEntropy(str: string) {
// TODO: calculate the shannon entropy
return 0;
}
@ngn13 Your change makes the entropy calculation always return zero, which is not the desired behaviour here.
I understand that, the previous implementation did not work properly (and idk how to fix it), so I commented it out and left a to-do note so someone who knows math can implement it later.
This will most likely work https://github.com/ngn13/server/pull/1 I don't have the environment to test it right now