<commit_before><?php

/**
 * Support.php
 * 
 * PHP version 5
 * 
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */

namespace Dcrypt;

/**
 * Provides numeric data conversion helper functions.
 * 
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */
class Support extends Str
{

    /**
     * Turns an integer into a 4 byte binary representation
     * 
     * @param int $dec Integer to convert to binary
     * 
     * @return string
     */
    protected static function dec2bin($dec)
    {
        return self::hex2bin(str_pad(dechex($dec), 8, '0', STR_PAD_LEFT));
    }

    /**
     * Reverses dec2bin
     * 
     * @param string $bin Binary string to convert to decimal
     * 
     * @return string
     */
    protected static function bin2dec($bin)
    {
        return hexdec(bin2hex($bin));
    }

    /**
     * An internal hex2bin implementation for PHP 5.3
     * 
     * @param string $hexstr
     * 
     * @return string
     */
    protected static function hex2bin($hexstr)
    {
        if (function_exists('hex2bin')) {
            return hex2bin($hexstr);
        }

        $n = strlen($hexstr);
        $sbin = '';
        $i = 0;
        while ($i < $n) {
            $a = substr($hexstr, $i, 2);
            $c = pack('H*', $a);
            if ($i == 0) {
                $sbin = $c;
            } else {
                $sbin.= $c;
            }
            $i+=2;
        }

        return $sbin;
    }

}<commit_msg>Update Support.php<commit_after><?php

/**
 * Support.php
 * 
 * PHP version 5
 * 
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */

namespace Dcrypt;

/**
 * Provides numeric data conversion helper functions.
 * 
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */
class Support extends Str
{

    /**
     * Turns an integer into a 4 byte binary representation
     * 
     * @param int $dec Integer to convert to binary
     * 
     * @return string
     */
    protected static function dec2bin($dec)
    {
        return self::hex2bin(str_pad(dechex($dec), 8, '0', STR_PAD_LEFT));
    }

    /**
     * Reverses dec2bin
     * 
     * @param string $bin Binary string to convert to decimal
     * 
     * @return string
     */
    protected static function bin2dec($bin)
    {
        return hexdec(bin2hex($bin));
    }

    /**
     * An internal hex2bin implementation for PHP 5.3
     * 
     * @param string $hexstr
     * 
     * @return string
     */
    protected static function hex2bin($hexstr)
    {
        if (function_exists('hex2bin')) {
            return hex2bin($hexstr);
        }

        $n = strlen($hexstr);
        $sbin = '';
        $i = 0;
        while ($i < $n) {
            $a = substr($hexstr, $i, 2);
            $c = pack('H*', $a);
            $sbin.= $c;
            $i+=2;
        }

        return $sbin;
    }

}
{'fraction_non_alphanumeric': 0.13821376281112738, 'fraction_numerical': 0.013177159590043924, 'mean_word_length': 1.8730025231286795, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, 'https://': 4, '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': '3776596', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1108, 'n_words': 279}