src/libraries/external/Dropbox/OAuth/Wordpress.php
/**
     * Hash function for hmac_sha1; uses native function if available.
     *
     * @param string $key
     * @param string $data
     * @return string
     */
Hash function for hmac_sha1; uses native function if available.
Hash function for hmac_sha1 ; uses native function if available .
private function hash_hmac_sha1($key, $data) {
        if (function_exists('hash_hmac') && in_array('sha1', hash_algos())) {
            return hash_hmac('sha1', $data, $key, true);
        } else {
            $blocksize = 64;
            $hashfunc = 'sha1';
            if (strlen($key) > $blocksize) {
                $key = pack('H*', $hashfunc($key));
            }
            $key = str_pad($key, $blocksize, chr(0x00));
            $ipad = str_repeat(chr(0x36), $blocksize);
            $opad = str_repeat(chr(0x5c), $blocksize);
            $hash = pack('H*', $hashfunc(( $key ^ $opad ) . pack('H*', $hashfunc(($key ^ $ipad) . $data))));
            return $hash;
        }
    }
private function hash_hmac_sha1 ( $ key , $ data ) { if ( function_exists ( 'hash_hmac' ) && in_array ( 'sha1' , hash_algos ( ) ) ) { return hash_hmac ( 'sha1' , $ data , $ key , true ) ; } else { $ blocksize = 64 ; $ hashfunc = 'sha1' ; if ( strlen ( $ key ) > $ blocksize ) { $ key = pack ( 'H*' , $ hashfunc ( $ key ) ) ; } $ key = str_pad ( $ key , $ blocksize , chr ( 0x00 ) ) ; $ ipad = str_repeat ( chr ( 0x36 ) , $ blocksize ) ; $ opad = str_repeat ( chr ( 0x5c ) , $ blocksize ) ; $ hash = pack ( 'H*' , $ hashfunc ( ( $ key ^ $ opad ) . pack ( 'H*' , $ hashfunc ( ( $ key ^ $ ipad ) . $ data ) ) ) ) ; return $ hash ; } }
Hash function for hmac_sha1; uses native function if available.
Hash function for hmac_sha1 ; uses native function if available .