<commit_before><?php

/*
 * This file is part of Hashids.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Hashids;

use InvalidArgumentException;

/**
 * This is the hashids class.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */
class Hashids implements HashidsInterface
{
    /* internal settings */

    const SEP_DIV = 3.5;
    const GUARD_DIV = 12;

    /* set at constructor */

    private $_alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
    private $_seps = 'cfhistuCFHISTU';
    private $_min_hash_length = 0;
    private $_math_functions = [];
    private $_max_int_value = 1000000000;
    private $_salt;

    public function __construct($salt = '', $min_hash_length = 0, $alphabet = '')
    {

        /* if either math precision library is present, raise $this->_max_int_value */

        if (function_exists('gmp_add')) {
            $this->_math_functions['add'] = 'gmp_add';
            $this->_math_functions['div'] = 'gmp_div';
            $this->_math_functions['str'] = 'gmp_strval';
        } elseif (function_exists('bcadd')) {
            $this->_math_functions['add'] = 'bcadd';
            $this->_math_functions['div'] = 'bcdiv';
            $this->_math_functions['str'] = 'strval';
        }

        $this->_lower_max_int_value = $this->_max_int_value;
        if ($this->_math_functions) {
            $this->_max_int_value = PHP_INT_MAX;
        }

        /* handle parameters */

        $this->_salt = $salt;

        if ((int) $min_hash_length > 0) {
            $this->_min_hash_length = (int) $min_hash_length;
        }

        if ($alphabet) {
            $this->_alphabet = implode('', array_unique(str_split($alphabet)));
        }

        if (strlen($this->_alphabet) < 16) {
            throw new InvalidArgumentException('Alphabet must contain at least 16 unique characters.');
        }

        if (strpos($this->_alphabet, ' ') !== false) {
            throw new InvalidArgumentException('Alphabet can\'t contain spaces.');
        }<commit_msg>Rename alias function<commit_after><?php

/*
 * This file is part of Hashids.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Hashids;

use InvalidArgumentException;

/**
 * This is the hashids class.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */
class Hashids implements HashidsInterface
{
    /* internal settings */

    const SEP_DIV = 3.5;
    const GUARD_DIV = 12;

    /* set at constructor */

    private $_alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
    private $_seps = 'cfhistuCFHISTU';
    private $_min_hash_length = 0;
    private $_math_functions = [];
    private $_max_int_value = 1000000000;
    private $_salt;

    public function __construct($salt = '', $min_hash_length = 0, $alphabet = '')
    {

        /* if either math precision library is present, raise $this->_max_int_value */

        if (function_exists('gmp_add')) {
            $this->_math_functions['add'] = 'gmp_add';
            $this->_math_functions['div'] = 'gmp_div_q';
            $this->_math_functions['str'] = 'gmp_strval';
        } elseif (function_exists('bcadd')) {
            $this->_math_functions['add'] = 'bcadd';
            $this->_math_functions['div'] = 'bcdiv';
            $this->_math_functions['str'] = 'strval';
        }

        $this->_lower_max_int_value = $this->_max_int_value;
        if ($this->_math_functions) {
            $this->_max_int_value = PHP_INT_MAX;
        }

        /* handle parameters */

        $this->_salt = $salt;

        if ((int) $min_hash_length > 0) {
            $this->_min_hash_length = (int) $min_hash_length;
        }

        if ($alphabet) {
            $this->_alphabet = implode('', array_unique(str_split($alphabet)));
        }

        if (strlen($this->_alphabet) < 16) {
            throw new InvalidArgumentException('Alphabet must contain at least 16 unique characters.');
        }

        if (strpos($this->_alphabet, ' ') !== false) {
            throw new InvalidArgumentException('Alphabet can\'t contain spaces.');
        }
{'fraction_non_alphanumeric': 0.1379151291512915, 'fraction_numerical': 0.01429889298892989, 'mean_word_length': 2.6292887029288705, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6669504', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1310, 'n_words': 302}