<commit_before><?php

class determPwGen
{
    private $rounds;
    private $salt;
    private $site_label;
    private $username;

    function __construct($rounds = 1000, $salt, $site_label, $username)
    {
        $this->rounds = $rounds;
        $this->salt = $salt;
        $this->site_label = $site_label;
        $this->username = $username;
    } 

    function generateHash() {
        if (isset($this->salt) && isset($this->site_label) && isset($this->username)) {
            $string = $this->site_label . $this->username;
            $hash = '';
            for ($i = 0; $i <= $this->rounds; $i++) {
                $hash = md5($this->salt . $string);
                $string = $hash;
            }
            return $hash;
        } else {
            return FALSE;
        }
    }
}<commit_msg>Now using SHA256 as hashing algorithm, much more secure<commit_after><?php

class determPwGen
{
    private $rounds;
    private $salt;
    private $site_label;
    private $username;

    function __construct($rounds = 1000, $salt, $site_label, $username)
    {
        $this->rounds = $rounds;
        $this->salt = $salt;
        $this->site_label = $site_label;
        $this->username = $username;
    } 

    function generateHash() {
        if (isset($this->salt) && isset($this->site_label) && isset($this->username)) {
            $string = $this->salt . $this->site_label . $this->username;
            $hash = '';
            for ($i = 0; $i <= $this->rounds; $i++) {
                $hash = hash('sha256', $string);
                $string = $hash;
            }
            return $hash;
        } else {
            return FALSE;
        }
    }
}
{'fraction_non_alphanumeric': 0.15679233991621783, 'fraction_numerical': 0.010173548773189706, 'mean_word_length': 1.8243243243243243, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '4291871', 'n_tokens_mistral': 545, 'n_tokens_neox': 503, 'n_words': 111}