<commit_before>'use strict';

$(document).ready(function () {
    var $form = $('#loginF');
    var $name = $('#name');
    var $pw = $('#pw');
    var $alert = $('#alert');
    var $hashfuncbtn = $('#hashfuncbtn');
    var hashfunc = document.getElementById("hashfunc");
    var $Hash_result = $('#Hash_result');
    var $redfuncbtn1 = $('#redfuncbtn1');
    var redfunc1 = document.getElementById("redfunc1");
    var $redfunc1_result = $('#redfunc1_result');
    var $redfuncbtn2 = $('#redfuncbtn2');
    var redfunc2 = document.getElementById("redfunc2");
    var $redfunc2_result = $('#redfunc2_result');
    var $redfuncbtn3 = $('#redfuncbtn3');
    var redfunc3 = document.getElementById("redfunc3");
    var $redfunc3_result = $('#redfunc3_result');    



// RainbowTable hash function handling    
    $hashfuncbtn.click(function(){
    	if (hashfunc.value > 999999 || hashfunc.value<100000){
    		alert('For simplicity, the password will only be at the range 100000 to 999999 and integer only');
    	} else{
    		//Simple hash function
    		$('#Hash_result').val((hashfunc.value.charAt(0))+(hashfunc.value.charAt(0))+(hashfunc.value.charAt(2))+(hashfunc.value.charAt(1))+(hashfunc.value.charAt(1))+(hashfunc.value.charAt(1)));
    	}
    		});
    
    // RainbowTable Reduction function #1 handling    
    $redfuncbtn1.click(function(){
    	if (redfunc1.value > 999999 || redfunc1.value< 100000){
    		alert("invalid hash");
    	} else{
    		//Simple hash function
    		$('#redfunc1_result').val((hashfunc.value.charAt(0))+((hashfunc.value.charAt(0)+12)%9)+(hashfunc.value.charAt(2))+(hashfunc.value.charAt(1))+(hashfunc.value.charAt(1))+(hashfunc.value.charAt(0)).toString());
    	}
    		});
    
    // RainbowTable Reduction function #2 handling    
    $redfuncbtn2.click(function(){
    	if (redfunc2.value > 999999 || redfunc2.value< 100000){
    		alert("invalid hash");
    	} else{
    		//Simple hash function
    		$('#redfunc2_result').val((hashfunc.value.charAt(0))+((hashfunc.value.charAt(0)+12)%9)+(hashfunc.value.charAt(2)*2%7)+(hashfunc.value.charAt(1))+(hashfunc.value.charAt(3))+(hashfunc.value.charAt(0)).toString());
    	}<commit_msg>Hash and reduction functions updated<commit_after>'use strict';

$(document).ready(function () {
    var $form = $('#loginF');
    var $name = $('#name');
    var $pw = $('#pw');
    var $alert = $('#alert');
    var $hashfuncbtn = $('#hashfuncbtn');
    var hashfunc = document.getElementById("hashfunc");
    var $Hash_result = $('#Hash_result');
    var $redfuncbtn1 = $('#redfuncbtn1');
    var redfunc1 = document.getElementById("redfunc1");
    var $redfunc1_result = $('#redfunc1_result');
    var $redfuncbtn2 = $('#redfuncbtn2');
    var redfunc2 = document.getElementById("redfunc2");
    var $redfunc2_result = $('#redfunc2_result');
    var $redfuncbtn3 = $('#redfuncbtn3');
    var redfunc3 = document.getElementById("redfunc3");
    var $redfunc3_result = $('#redfunc3_result');    



// RainbowTable hash function handling    
    $hashfuncbtn.click(function(){
    	if (hashfunc.value > 999999 || hashfunc.value<100000){
    		alert('For simplicity, the password will only be at the range 100000 to 999999 and integer only');
    	} else{
    		//Simple hash function
    		$('#Hash_result').val(((hashfunc.value.charAt(0))+(hashfunc.value.charAt(1))).toString()+(hashfunc.value%9).toString()+(hashfunc.value%8).toString());
    	}
    		});
    
    // RainbowTable Reduction function #1 handling    
    $redfuncbtn1.click(function(){
    	if (redfunc1.value > 9999 || redfunc1.value< 1000){
    		alert("invalid hash");
    	} else{
    		//Simple hash function
    		$('#redfunc1_result').val((redfunc1.value.charAt(0)+13)%9+((redfunc1.value.charAt(0)+12)%9).toString()+(redfunc1.value.charAt(3)).toString()+(redfunc1.value.charAt(1)).toString()+(redfunc1.value.charAt(2)).toString());
    	}
    		});
    
    // RainbowTable Reduction function #2 handling    
    $redfuncbtn2.click(function(){
    	if (redfunc2.value > 999999 || redfunc2.value< 100000){
    		alert("invalid hash");
    	} else{
    		//Simple hash function
    		$('#redfunc2_result').val((hashfunc.value.charAt(0))+((hashfunc.value.charAt(0)+12)%9)+(hashfunc.value.charAt(2)*2%7)+(hashfunc.value.charAt(1))+(hashfunc.value.charAt(3))+(hashfunc.value.charAt(0)).toString());
    	}
{'fraction_non_alphanumeric': 0.18714121699196326, 'fraction_numerical': 0.04707233065442021, 'mean_word_length': 3.8998875140607425, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2343001', 'n_tokens_mistral': 1553, 'n_tokens_neox': 1457, 'n_words': 238}