5 ms·
Additionally. "Adding support for spaces only in the middle of the password would make the regular expression defining them three times longer, Engberg said."
by seanalltogether 14y ago
Additionally.
"Adding support for spaces only in the middle of the password would make the regular expression defining them three times longer, Engberg said."
So they admit they already have the regex definition that would allow this, but for some reason don't want to put it in production? How strange.
- shawabawa3 14y agobut it's 3 times longer! Think of all the ram that would use! They can't even cite performance reasons as hashing passwords should be very cpu intensive anyway
- troels 14y agoThe regexp might be longer to write, but I doubt it would perform worse, once compiled.
- Terretta 14y agoSounds like he's thinking his regex is of their allowed "set" of [A-Za-z0-9!@#$%^&*()_.-], and thinks that to support space but not at start or end, he'd need ^[set][ set]{6,}[set]$, repeating his set 3 times except with a space added to the middle set. That's not accurate. He can add a space to his set, then put a not-space assertion at the start and end, like ^(?! )[ set]{8,}(?<! )$ and call it a day. (And perhaps \A and \Z instead of ^ and $ depending on what he does with new lines.)
- X-Istence 14y agoThe better question is why is there a regex in the first place? If someone wants to set their password to some random chinese characters then why shouldn't they be able to?