<commit_before>import {Component, ViewChild} from "@angular/core";
import {Router} from "@angular/router";
import {LoginService} from "../services/login-service";
import {Login} from "../classes/login";
import {Status} from "../classes/status";
import {SaltRequest} from "../classes/salt-request";
import {SaltService} from "../services/salt-service";
import {Salt} from "../classes/salt";
import * as jsbnAll from "../../jsbn/jsbn-all"

@Component({
	templateUrl: "./templates/home.php"
})

export class HomeComponent {
	@ViewChild("loginForm") loginForm: any;
	loginData: Login = new Login(null, "", "", "", "", "");
	salt: Salt = new Salt(null, "");
	loginStatus : Status = null;
	saltRequest: SaltRequest = new SaltRequest("", false);
	// localStorageService: LocalStorageService = new LocalStorageService("", "", "", "", "", "", "");
	//storing: 1) Username, 2)Password, 3)Multiplier, 4)PublicKeyX, 5)PublicKeyY, 6) eCCP,

	constructor(private SaltService: SaltService, private loginService: LoginService, private router: Router) {

	}

	login(): void {
		this.saltRequest.username = this.loginData.username;
		this.SaltService.salt(this.saltRequest)
			.subscribe(salt => {
				this.salt.salt = salt;
				this.salt.id = id;
				this.loginData.salt = this.salt.salt;
				this.loginData.userId = this.salt.id;
				console.log(this.salt.salt);

				let sendersPrivateMultiplier = jsbnAll.generateSendersPrivateMultiplier(this.loginData.password, this.salt.salt);

				let sendersMultipliedPoint = jsbnAll.calculateSendersMultipliedPoint(sendersPrivateMultiplier);

				this.loginData.publicKeyX = sendersMultipliedPoint[0];
				this.loginData.publicKeyY = sendersMultipliedPoint[1];
				// console.log("Key X" + this.loginData.publicKeyX);
				// console.log("\nKey Y" + this.loginData.publicKeyY);
				// console.log("\nSalt" + this.loginData.salt);
				// this.loginData.password = "<PASSWORD>";

				this.loginService.login(this.loginData)
					.subscribe(currentStatus => {
						this.loginStatus = currentStatus;<commit_msg>trying to turn salt into an array<commit_after>import {Component, ViewChild} from "@angular/core";
import {Router} from "@angular/router";
import {LoginService} from "../services/login-service";
import {Login} from "../classes/login";
import {Status} from "../classes/status";
import {SaltRequest} from "../classes/salt-request";
import {SaltService} from "../services/salt-service";
import {Salt} from "../classes/salt";
import * as jsbnAll from "../../jsbn/jsbn-all"

@Component({
	templateUrl: "./templates/home.php"
})

export class HomeComponent {
	@ViewChild("loginForm") loginForm: any;
	loginData: Login = new Login(null, "", "", "", "", "");
	salt: Salt[]= [];
	loginStatus : Status = null;
	saltRequest: SaltRequest = new SaltRequest("", false);
	// localStorageService: LocalStorageService = new LocalStorageService("", "", "", "", "", "", "");
	//storing: 1) Username, 2)Password, 3)Multiplier, 4)PublicKeyX, 5)PublicKeyY, 6) eCCP,

	constructor(private SaltService: SaltService, private loginService: LoginService, private router: Router) {

	}

	login(): void {
		this.saltRequest.username = this.loginData.username;
		this.SaltService.salt(this.saltRequest)
			.subscribe(salt => {
				this.salt = salt;
				this.loginData.salt = this.salt[0]["salt"];
				this.loginData.userId = this.salt[0]["id"];;
				console.log("salt: " + this.loginData.salt);
				console.log("id: " + this.loginData.userId);

				let sendersPrivateMultiplier = jsbnAll.generateSendersPrivateMultiplier(this.loginData.password, this.loginData.salt);

				let sendersMultipliedPoint = jsbnAll.calculateSendersMultipliedPoint(sendersPrivateMultiplier);

				this.loginData.publicKeyX = sendersMultipliedPoint[0];
				this.loginData.publicKeyY = sendersMultipliedPoint[1];
				// console.log("Key X" + this.loginData.publicKeyX);
				// console.log("\nKey Y" + this.loginData.publicKeyY);
				// console.log("\nSalt" + this.loginData.salt);
				// this.loginData.password = "<PASSWORD>";

				this.loginService.login(this.loginData)
					.subscribe(currentStatus => {
						this.loginStatus = currentStatus;
{'fraction_non_alphanumeric': 0.16319107662463628, 'fraction_numerical': 0.004364694471387003, 'mean_word_length': 4.544354838709677, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2208398', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1278, 'n_words': 254}