<commit_before>    /* 
    * MIT License
    * Copyright (c) 2017 <NAME>
    */

// action by click on button
var getGeneratePassword = document.getElementById("generatePassword");
getGeneratePassword.addEventListener("click", output, false);
    
// function to check choosen options and make a concatenated string
function checkOptions() {
    // variables to get user input
    var getLowercaseChar = document.getElementById("inputLowerCaseCharacters"),
        getUppercaseChar = document.getElementById("inputUpperCaseCharacters"),
        getNumbers = document.getElementById("inputNumbers"),
        getSymbols = document.getElementById("inputSymbols");
        // getExcludeSimChar = document.getElementById("inputExcludeSimilarCharacters"),
        // getMakeSpeakablePW = document.getElementById("inputMakeSpeakablePassword"),
        // getChooseFirstChar = document.getElementsByName("inputChooseFirstCharacter"),
        // getChooseLastChar = document.getElementsByName("inputChooseLastCharacter");

    // variables to generate password
    var lowercaseChar = "abcdefghijklmnopqrstuvwxyz",
        uppercaseChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
        numbers = "1234567890",
        symbols = document.getElementById("actualSymbols").value;

    // concatenated string
    var concatenatedString = "";

    if (getLowercaseChar.checked === true) {
        concatenatedString += lowercaseChar;
    } 

    if (getUppercaseChar.checked === true) {
        concatenatedString += uppercaseChar;
    } 

    if (getNumbers.checked === true) {
        concatenatedString += numbers;
    } 

    if (getSymbols.checked === true) {
        concatenatedString += symbols;
    }

    return concatenatedString;
}


// function for random numbers
function randomNumbers(receivedString) {
    var stringLen = receivedString.length,
    random = Math.round((stringLen - 1) * Math.random() + 0 );

    return random;
}

// get random character from string
function getCharFromString(receivedString) {
    var randomNumber = randomNumbers(receivedString),
        actualChar = receivedString.charAt(randomNumber);

    return actualChar;
}


// call functions and output result
function output() {
    var getQuantity = document.getElementById("inputQuantity").value,
        getOutputQuantity = document.getElementById("outputQuantity").innerHTML = getQuantity,
        getPwLength = document.getElementById("inputPasswordLength").value;

    var password = "",
        passwordChar;

    var i,
        j;

    var checkOptionsResult = checkOptions();

    for (i = 0; i < getQuantity; i++) {
        for (j = 0; j < getPwLength; j++) {
            passwordChar = getCharFromString(checkOptionsResult);
            password += passwordChar;
        }
        password += "\n";
    }

    var output = document.getElementById("outputGeneratedPasswords").innerHTML = password;
}<commit_msg>namespace 'easyJsPwGen' added<commit_after>    /* 
    * MIT License
    * Copyright (c) 2017 <NAME>
    */

var easyJsPwGen = {

    // function to check choosen options and make a concatenated string
    // function checkOptions() {
    checkOptions: function() {
        // variables to get user input
        var getLowercaseChar = document.getElementById("inputLowerCaseCharacters"),
            getUppercaseChar = document.getElementById("inputUpperCaseCharacters"),
            getNumbers = document.getElementById("inputNumbers"),
            getSymbols = document.getElementById("inputSymbols");
            // getExcludeSimChar = document.getElementById("inputExcludeSimilarCharacters"),
            // getMakeSpeakablePW = document.getElementById("inputMakeSpeakablePassword"),
            // getChooseFirstChar = document.getElementsByName("inputChooseFirstCharacter"),
            // getChooseLastChar = document.getElementsByName("inputChooseLastCharacter");

        // variables to generate password
        var lowercaseChar = "abcdefghijklmnopqrstuvwxyz",
            uppercaseChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
            numbers = "1234567890",
            symbols = document.getElementById("actualSymbols").value;

        // concatenated string
        var concatenatedString = "";

        if (getLowercaseChar.checked === true) {
            concatenatedString += lowercaseChar;
        } 

        if (getUppercaseChar.checked === true) {
            concatenatedString += uppercaseChar;
        } 

        if (getNumbers.checked === true) {
            concatenatedString += numbers;
        } 

        if (getSymbols.checked === true) {
            concatenatedString += symbols;
        }

        return concatenatedString;
    },


    // function for random numbers
    // function randomNumbers(receivedString) {
    randomNumbers: function(receivedString) {
        var stringLen = receivedString.length,
        random = Math.round((stringLen - 1) * Math.random() + 0 );

        return random;
    },

    // get random character from string
    // function getCharFromString(receivedString) {
    getCharFromString: function(receivedString) {
        var randomNumber = easyJsPwGen.randomNumbers(receivedString),
            actualChar = receivedString.charAt(randomNumber);

        return actualChar;
    },


    // call functions and output result
    // function output() {
    output: function() {
        var getQuantity = document.getElementById("inputQuantity").value,
            getOutputQuantity = document.getElementById("outputQuantity").innerHTML = getQuantity,
            getPwLength = document.getElementById("inputPasswordLength").value;

        var password = "",
            passwordChar;

        var i,
            j;

        var checkOptionsResult = easyJsPwGen.checkOptions();

        for (i = 0; i < getQuantity; i++) {
            for (j = 0; j < getPwLength; j++) {
                passwordChar = easyJsPwGen.getCharFromString(checkOptionsResult);
                password += <PASSWORD>;
            }
            password += <PASSWORD>";
        }

        var output = document.getElementById("outputGeneratedPasswords").innerHTML = password;
    }
};

// action by click on button
var getGeneratePassword = document.getElementById("generatePassword");
getGeneratePassword.addEventListener("click", easyJsPwGen.output, false);
    
{'fraction_non_alphanumeric': 0.10084167063681118, 'fraction_numerical': 0.005717008099094807, 'mean_word_length': 2.89005558987029, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2719758', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1548, 'n_words': 346}