<commit_before>class Psswrd {

    constructor(args = {}) {

        /**
         * Force to generate cryptographically random values
         * @type {boolean}
         */
        this.strict = (typeof args.strict === 'undefined') ? true : args.strict;

        /**
         * Default password length
         * @type {number}
         */
        this.length = (typeof args.length === 'undefined') ? 12 : args.length;

        /**
         * Default alphabetic characters
         * @type {string}
         */
        this.letters = (typeof args.letters === 'undefined') ? 'AaBaCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz' : args.letters;

        /**
         * Default numeric characters
         * @type {string}
         */
        this.numbers = (typeof args.numbers === 'undefined') ? '0123456789' : args.numbers;

        /**
         * Default special characters
         * @type {string}
         */
        this.special = (typeof args.special === 'undefined') ? '!$%@#' : args.special;

    }

    /**
     * getRandomPassword - Generate a (by default cryptographically) secure random password
     *
     * @param  {number} length the length of password being generated
     * @return {string}        generated password
     */
    getRandomPassword(length) {
        if (!Number.isInteger(length)) {
            length = this.length;
        }

        var characters = this._getCharacters();

        var password = '';
        for (let i = 0; i < length; i++) {
            password += characters.charAt(this._getRandomInt(0, (characters.length - 1)));
        }

        return password;
    }

    /**
     * _getRandomInt - Generate and return a random generated integer
     *
     * @param  {number} min minimum interger being returned<commit_msg>Update to throw an error if length is not set to be an integer<commit_after>class Psswrd {

    constructor(args = {}) {

        /**
         * Force to generate cryptographically random values
         * @type {boolean}
         */
        this.strict = (typeof args.strict === 'undefined') ? true : args.strict;

        /**
         * Default password length
         * @type {number}
         */
        this.length = (typeof args.length === 'undefined') ? 12 : args.length;

        /**
         * Default alphabetic characters
         * @type {string}
         */
        this.letters = (typeof args.letters === 'undefined') ? 'AaBaCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz' : args.letters;

        /**
         * Default numeric characters
         * @type {string}
         */
        this.numbers = (typeof args.numbers === 'undefined') ? '0123456789' : args.numbers;

        /**
         * Default special characters
         * @type {string}
         */
        this.special = (typeof args.special === 'undefined') ? '!$%@#' : args.special;

    }

    /**
     * getRandomPassword - Generate a (by default cryptographically) secure random password
     *
     * @param  {number} length the length of password being generated
     * @return {string}        generated password
     */
    getRandomPassword(length = this.length) {
        if (!Number.isInteger(length)) {
            throw new Error("Length must be an integer.");
            return;
        }

        var characters = this._getCharacters();

        var password = '';
        for (let i = 0; i < length; i++) {
            password += characters.charAt(this._getRandomInt(0, (characters.length - 1)));
        }

        return password;
    }

    /**
     * _getRandomInt - Generate and return a random generated integer
     *
     * @param  {number} min minimum interger being returned
{'fraction_non_alphanumeric': 0.12157721796276014, 'fraction_numerical': 0.008214676889375685, 'mean_word_length': 1.9224, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3983913', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1009, 'n_words': 259}