<commit_before>#include <iostream>
#include <string.h>
#include "crypto.h"
#include "account.h"
#include "gen_functions.h"
#include <openssl/sha.h>
using namespace std;
account::account(int an, char * p, int b, bool lock) {
	account_num = an;
	pin_hash = new char[SHA_DIGEST_LENGTH];
	pin_hash = hash_pin(p);
	balance = b;
	locked = lock;
}
bool account::check_creds(int an, char * p_hash) {
	if(account_num != an) {
		return false;
	}
	if(strcmp(p_hash,pin_hash) != 0) {
		return false;
	}
	return true;
}
bool account::withdraw(int amount) {
	// client (ATM) muse interpret these codes...
	if(amount > balance) {
		return false;
	}
	else {
		balance = balance - amount;
		return true;
	}
}
bool account::deposit(int amount) {
	balance += amount;
	return true;
}
int account::get_balance() {
	return balance;
}
bool account::check_creds_act(account act) {
	if(act.check_creds(account_num, pin_hash)) {
		return true;
	}
	return false;
}
bool account::is_locked() {
	return locked;
}
void account::lock() {
	locked = true;
}
void account::login() {
	logged_in = true;
}
void account::logout() {
	logged_in = false;
}
bool account::is_logged_in() {
	return logged_in;
}
<commit_msg>added debugging line to uncomment<commit_after>#include <iostream>
#include <string.h>
#include "crypto.h"
#include "account.h"
#include "gen_functions.h"
#include <openssl/sha.h>
using namespace std;
account::account(int an, char * p, int b, bool lock) {
	account_num = an;
	pin_hash = new char[SHA_DIGEST_LENGTH];
	pin_hash = hash_pin(p);
	balance = b;
	locked = lock;
	// cout << account_num << " " << raw_to_hex((unsigned char*)pin_hash, SHA_DIGEST_LENGTH) << endl;
}
bool account::check_creds(int an, char * p_hash) {
	if(account_num != an) {
		return false;
	}
	if(strcmp(p_hash,pin_hash) != 0) {
		return false;
	}
	return true;
}
bool account::withdraw(int amount) {
	// client (ATM) muse interpret these codes...
	if(amount > balance) {
		return false;
	}
	else {
		balance = balance - amount;
		return true;
	}
}
bool account::deposit(int amount) {
	balance += amount;
	return true;
}
int account::get_balance() {
	return balance;
}
bool account::check_creds_act(account act) {
	if(act.check_creds(account_num, pin_hash)) {
		return true;
	}
	return false;
}
bool account::is_locked() {
	return locked;
}
void account::lock() {
	locked = true;
}
void account::login() {
	logged_in = true;
}
void account::logout() {
	logged_in = false;
}
bool account::is_logged_in() {
	return logged_in;
}

{'fraction_non_alphanumeric': 0.1479242241031842, 'fraction_numerical': 0.0008061265618702137, 'mean_word_length': 4.679633867276888, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 11, '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': '6577173', 'n_tokens_mistral': 957, 'n_tokens_neox': 934, 'n_words': 226}