Forum Stats

  • 3,825,276 Users
  • 2,260,494 Discussions
  • 7,896,475 Comments

Discussions

password verify function to avoid repetitive characters in a new password

User_6CB7J
User_6CB7J Member Posts: 2 Green Ribbon

Hello, looking for a function to restrict user from creating a new password with repetitive characters like (aaaaaa) with minimum of two characters only are allowed.

The look currently I am looking at is this one:-


--Check if the password contains repeating characters like "11" or "aa"


    FOR i in 1..m-1 loop

    IF substr(password,i,1)=substr(password,i+1,1) THEN

    raise_application_error(-20000, 'New password may not contain repeating characters');

    END IF;

    END LOOP;



This one is good in not allowing repetitive characters e (like aaOrange123). But we wanted it to allow at least two characters and start not allowing more than two characters.

Tagged:

Answers