lib/BlockCypher/Rest/ApiContext.php
private function generateRequestId()
    {
        static $pid = -1;
        static $addr = -1;

        if ($pid == -1) {
            $pid = getmypid();
        }

        if ($addr == -1) {
            if (array_key_exists('SERVER_ADDR', $_SERVER)) {
                $addr = ip2long($_SERVER['SERVER_ADDR']);
            } else {
                $addr = php_uname('n');
            }
        }

        return $addr . $pid . $_SERVER['REQUEST_TIME'] . mt_rand(0, 0xffff);
    }
private function generateRequestId()
    {
        static $pid = -1;
        static $addr = -1;

        if ($pid == -1) {
            $pid = getmypid();
        }

        if ($addr == -1) {
            if (array_key_exists('SERVER_ADDR', $_SERVER)) {
                $addr = ip2long($_SERVER['SERVER_ADDR']);
            } else {
                $addr = php_uname('n');
            }
        }

        return $addr . $pid . $_SERVER['REQUEST_TIME'] . mt_rand(0, 0xffff);
    }
private function generateRequestId ( ) { static $ pid = - 1 ; static $ addr = - 1 ; if ( $ pid == - 1 ) { $ pid = getmypid ( ) ; } if ( $ addr == - 1 ) { if ( array_key_exists ( 'SERVER_ADDR' , $ _SERVER ) ) { $ addr = ip2long ( $ _SERVER [ 'SERVER_ADDR' ] ) ; } else { $ addr = php_uname ( 'n' ) ; } } return $ addr . $ pid . $ _SERVER [ 'REQUEST_TIME' ] . mt_rand ( 0 , 0xffff ) ; }
Generates a unique per request id that
can be used to set the BlockCypher-Request-Id header
that is used for idempotency

@return string
Generates a unique per request id that can be used to set the BlockCypher - Request - Id header that is used for idempotency