modules

ac-bundle-module-utils-password

utils/password.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: test, medium, strong

test

function(password, level) {
  if (typeof level === "undefined") level = "medium";
  return mod[level]().test(password);
}

medium

function() {
  return new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");
}

strong

function() {
  return new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");
}

Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *