<commit_before>
;(function(u, window, document, undefined) {
	'use strict';

	var pluginName = 'strength',
			defaults = {
				meter: '#password-meter',
				classes: [
					'veryweak',
					'veryweak',
					'weak',
					'medium',
					'strong'
				],
				specialChars: /([!,%,&,@,#,$,^,*,?,_,~])/,
				delay: 0
			};

	function Strength(element, options) {
		this.el = element;
		this._el = u(this.el);
		this.options = u.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	}

	Strength.prototype = {

		init: function() {

			var characters = 0;
			var capitalletters = 0;
			var loweletters = 0;
			var number = 0;
			var special = 0;

			var upperCase = /[A-Z]/;
			var lowerCase = /[a-z]/;
			var numbers = /[0-9]/;
			var specialChars = this.options.specialChars;

			var classes = this.options.classes;
			var meter = u(this.options.meter);
			var checkDelay = this.options.delay;
			var checkTimeout;

			function checkStrength(value, total) {
				characters = value.length > 8 ? 1 : -1;
				capitalletters = +!!value.match(upperCase);
				loweletters = +!!value.match(lowerCase);
				number = +!!value.match(numbers);
				special = +!!value.match(specialChars);

				total = characters + capitalletters + loweletters + number + special;

				!value.length && (total = -1);

				updateMeter(total);
			}

			function updateMeter(total) {
				meter.removeClass(classes.join(' '));
				total >= 0 && meter.addClass(classes[Math.min(total, classes.length -1)]);
			}

			this._el.on('input', function(event) {
				clearTimeout(checkTimeout);
				checkTimeout = setTimeout(checkStrength, checkDelay, this.value);
			});

		}
	};

	// A really lightweight plugin wrapper around the constructor,
	// preventing against multiple instantiations
	u.fn[pluginName] = function(options) {
			return this.each(function() {
					if (!u(this).data(pluginName)) {
							u(this).data(pluginName, new Strength(this, options));
					}
			});
	};

})(u, window, document);
<commit_msg>change default regex for special chars<commit_after>
;(function(u, window, document, undefined) {
	'use strict';

	var pluginName = 'strength',
			defaults = {
				meter: '#password-meter',
				classes: [
					'veryweak',
					'veryweak',
					'weak',
					'medium',
					'strong'
				],
				delay: 0
				specialChars: /[^a-zA-Z0-9]/,
			};

	function Strength(element, options) {
		this.el = element;
		this._el = u(this.el);
		this.options = u.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	}

	Strength.prototype = {

		init: function() {

			var characters = 0;
			var capitalletters = 0;
			var loweletters = 0;
			var number = 0;
			var special = 0;

			var upperCase = /[A-Z]/;
			var lowerCase = /[a-z]/;
			var numbers = /[0-9]/;
			var specialChars = this.options.specialChars;

			var classes = this.options.classes;
			var meter = u(this.options.meter);
			var checkDelay = this.options.delay;
			var checkTimeout;

			function checkStrength(value, total) {
				characters = value.length > 8 ? 1 : -1;
				capitalletters = +!!value.match(upperCase);
				loweletters = +!!value.match(lowerCase);
				number = +!!value.match(numbers);
				special = +!!value.match(specialChars);

				total = characters + capitalletters + loweletters + number + special;

				!value.length && (total = -1);

				updateMeter(total);
			}

			function updateMeter(total) {
				meter.removeClass(classes.join(' '));
				total >= 0 && meter.addClass(classes[Math.min(total, classes.length -1)]);
			}

			this._el.on('input', function(event) {
				clearTimeout(checkTimeout);
				checkTimeout = setTimeout(checkStrength, checkDelay, this.value);
			});

		}
	};

	// A really lightweight plugin wrapper around the constructor,
	// preventing against multiple instantiations
	u.fn[pluginName] = function(options) {
			return this.each(function() {
					if (!u(this).data(pluginName)) {
							u(this).data(pluginName, new Strength(this, options));
					}
			});
	};

})(u, window, document);

{'fraction_non_alphanumeric': 0.15862068965517243, 'fraction_numerical': 0.007389162561576354, 'mean_word_length': 3.1396534148827726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2924607', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1317, 'n_words': 296}