HEX
Server: Apache
System: Linux server 5.4.0-56-generic #62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020 x86_64
User: losadagest (10000)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/aceitunaslosada.com/web/wp-content/plugins/redsysoficial/apiRedsys/hash.php
<?php

/**
 * Replace hash()
 *
 * @category    PHP
 * @package     PHP_Compat
 * @license     LGPL - http://www.gnu.org/licenses/lgpl.html
 * @copyright   2004-2007 Aidan Lister <aidan@php.net>, Arpad Ray <arpad@php.net>
 * @link        http://php.net/function.hash
 * @author      revulo <revulon@gmail.com>
 * @since       PHP 5.1.2
 * @require     PHP 4.0.0 (user_error)
 */
function php_compat_hash($algo, $data, $raw_output = false)
{
    $algo = strtolower($algo);
    switch ($algo) {
        case 'md5':
            $hash = md5($data);
            break;

        case 'sha1':
            if (!function_exists('sha1')) {
                require dirname(__FILE__) . '/sha1.php';
            }
            $hash = sha1($data);
            break;

        case 'sha256':
            require_once dirname(__FILE__) . '/sha256.php';
            $hash = SHA256::hash($data);
            break;

        default:
            user_error('hash(): Unknown hashing algorithm: ' . $algo, E_USER_WARNING);
            return false;
    }

    if ($raw_output) {
        return pack('H*', $hash);
    } else {
        return $hash;
    }
}


// Define
if (!function_exists('hash')) {
    function hash($algo, $data, $raw_output = false)
    {
        return php_compat_hash($algo, $data, $raw_output);
    }
}
?>