<commit_before><?php
/**
 * This file is part of the PHPLucidFrame library.
 * The script executes the command `php lucidframe secret:generate`
 *
 * @package     LucidFrame\Console
 * @since       PHPLucidFrame v 1.11.0
 * @copyright   Copyright (c), PHPLucidFrame.
 * @author      <NAME>. <<EMAIL>>
 * @link        http://phplucidframe.sithukyaw.com
 * @license     http://www.opensource.org/licenses/mit-license.php MIT License
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.txt
 */

_consoleCommand('secret:generate')
    ->setDescription('Generate a secret hash key')
    ->addOption('method', 'm', 'The hashing algorithm method (e.g. "md5", "sha256", etc..)', 'md5')
    ->addOption('data', 'd', 'Secret text to be hashed.')
    ->setDefinition(function(\LucidFrame\Console\Command $cmd) {
        $data = $cmd->getOption('data');
        if (!$data) {
            $data = time();
        }

        $secret = hash($cmd->getOption('method'), $data) . "\n";
        $file = INC . '.secret';
        file_put_contents($file, $secret);
    })
    ->register();
<commit_msg>Update file comment block for the command `secret:generate`<commit_after><?php
/**
 * This file is part of the PHPLucidFrame library.
 * The script executes the command `php lucidframe secret:generate [options]`
 *
 * @package     LucidFrame\Console
 * @since       PHPLucidFrame v 1.11.0
 * @copyright   Copyright (c), PHPLucidFrame.
 * @author      <NAME>. <<EMAIL>>
 * @link        http://phplucidframe.sithukyaw.com
 * @license     http://www.opensource.org/licenses/mit-license.php MIT License
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.txt
 */

_consoleCommand('secret:generate')
    ->setDescription('Generate a secret hash key')
    ->addOption('method', 'm', 'The hashing algorithm method (e.g. "md5", "sha256", etc..)', 'md5')
    ->addOption('data', 'd', 'Secret text to be hashed.')
    ->setDefinition(function(\LucidFrame\Console\Command $cmd) {
        $data = $cmd->getOption('data');
        if (!$data) {
            $data = time();
        }

        $secret = hash($cmd->getOption('method'), $data) . "\n";
        $file = INC . '.secret';
        file_put_contents($file, $secret);
    })
    ->register();

{'fraction_non_alphanumeric': 0.15670367207514946, 'fraction_numerical': 0.007685738684884714, 'mean_word_length': 2.991482112436116, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2350486', 'n_tokens_mistral': 731, 'n_tokens_neox': 712, 'n_words': 204}