) No Duplicate Characters: ( dont use the same character more than once ) No Sequential Characters: ( dont use sequential characters, e.g. To see if it's repeating, I used () that loops through the chunk and check if they're similar and return a boolean based on the expression. No Similar Characters: ( dont use characters like i, l, 1, L, o, 0, O, etc. I used () to find if it's sequential based off the abc and num constants( ref). Instead of the inner for loop, I chunked the string to n using () to see ahead n characters. Our experiences vary in intensity, we have a perception of time passing so we have sequential experiences, we experience some synesthesia between senses, etc etc. This means that a lowercase 'a' is not the same as an uppercase. The sequential character is known as an earthquake swarm, a phenomenon of periodic tremors that can continue for months or even a year before quieting. When the password level (QPWDLVL) system value has a value of 2 or 3, the test for repeated characters is case sensitive. I know this can also be done with regx but im trying to get it done without it. This value provides additional security by preventing users from specifying passwords that are easy to guess, such as the same character repeated several times. Im trying to to see if I can optimize this and make it more readable with underscore and/or even make time/space complexity better. If (isSequentialTemp) isSequential = true (myStr.charCodeAt(i) = myStr.charCodeAt(j) - (n - 1)) ? isSequentialTemp = true : isSequentialTemp = false (myStr.charCodeAt(i) = myStr.charCodeAt(j)) ? isRepeatingTemp = true: isRepeatingTemp = false When string contains 3 or more repeated (lll, 444, MMm, const input = "Dfdf123125" The function below can detect when stringĬontains 3 or more ordered characters such as (234, efg, LmN)
#SEQUENTIAL CHARACTERS CODE#
Im new to javascript so Im tring to make more readable code using functions in libraries like underscore.
I have code that I am trying to refactor.