Make WordPress Core


Ignore:
Timestamp:
12/19/2015 05:10:29 AM (9 years ago)
Author:
DrewAPicture
Message:

Docs: Add missing DocBlocks for hash_hmac() and _hash_hmac().

Both will be ignored from parsing as and serve as compat functions for PHP's hash_hmac().

Introduced in [18111].

See #32246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r36020 r36021  
    218218
    219219if ( !function_exists('hash_hmac') ):
     220/**
     221 * Compat function to mimic hash_hmac().
     222 *
     223 * @ignore
     224 * @since 3.2.0
     225 *
     226 * @see _hash_hmac()
     227 *
     228 * @param string $algo       Hash algorithm. Accepts 'md5' or 'sha1'.
     229 * @param string $data       Data to be hashed.
     230 * @param string $key        Secret key to use for generating the hash.
     231 * @param bool   $raw_output Optional. Whether to output raw binary data (true),
     232 *                           or lowercase hexits (false). Default false.
     233 * @return string|false The hash in output determined by `$raw_output`. False if `$algo`
     234 *                      is unknown or invalid.
     235 */
    220236function hash_hmac($algo, $data, $key, $raw_output = false) {
    221237    return _hash_hmac($algo, $data, $key, $raw_output);
     
    223239endif;
    224240
     241/**
     242 * Internal compat function to mimic hash_hmac().
     243 *
     244 * @ignore
     245 * @since 3.2.0
     246 *
     247 * @param string $algo       Hash algorithm. Accepts 'md5' or 'sha1'.
     248 * @param string $data       Data to be hashed.
     249 * @param string $key        Secret key to use for generating the hash.
     250 * @param bool   $raw_output Optional. Whether to output raw binary data (true),
     251 *                           or lowercase hexits (false). Default false.
     252 * @return string|false The hash in output determined by `$raw_output`. False if `$algo`
     253 *                      is unknown or invalid.
     254 */
    225255function _hash_hmac($algo, $data, $key, $raw_output = false) {
    226256    $packs = array('md5' => 'H32', 'sha1' => 'H40');
Note: See TracChangeset for help on using the changeset viewer.