private function getNonce($length = 20)
    {
        $parts = explode('.', number_format(microtime(true), 22, '.', ''));
        if (! isset($parts[1])) {
            $parts[1] = 0;
        }
        $nonce = base_convert($parts[1], 10, 36);

        for ($i = 0; $i < $length - strlen($nonce); $i++) {
            $nonce .= base_convert(mt_rand(0, 35), 10, 36);
        }

        return $nonce;
    }
private function getNonce($length = 20)
    {
        $parts = explode('.', number_format(microtime(true), 22, '.', ''));
        if (! isset($parts[1])) {
            $parts[1] = 0;
        }
        $nonce = base_convert($parts[1], 10, 36);

        for ($i = 0; $i < $length - strlen($nonce); $i++) {
            $nonce .= base_convert(mt_rand(0, 35), 10, 36);
        }

        return $nonce;
    }
private function getNonce ( $ length = 20 ) { $ parts = explode ( '.' , number_format ( microtime ( true ) , 22 , '.' , '' ) ) ; if ( ! isset ( $ parts [ 1 ] ) ) { $ parts [ 1 ] = 0 ; } $ nonce = base_convert ( $ parts [ 1 ] , 10 , 36 ) ; for ( $ i = 0 ; $ i < $ length - strlen ( $ nonce ) ; $ i ++ ) { $ nonce .= base_convert ( mt_rand ( 0 , 35 ) , 10 , 36 ) ; } return $ nonce ; }
Generic nonce generating function for the request.
It's important that it's long enough as the spec says the
server will reject any request that reuses one.

@param int $length
@return string
Generic nonce generating function for the request . It s important that it s long enough as the spec says the server will reject any request that reuses one .