Generate a function header for given signature

@param  array  $params Param names as keys, param types as values
@return string
340016
protected function getHeader(array $params)
	{
		// Prepare the function's header
		$header = "/**\n";
		foreach ($params as $paramName => $paramType)
		{
			$header .= '* @param {' . $paramType . '} ' . $paramName . "\n";
		}
		$header .= "*/\n";

		return $header;
	}
391853
protected function buildAuthenticator($params = array())
    {
        $signature = new Signature($this->networkKey);
        $signature->getNoncer()->setLength(self::NONCE_LENGTH);

        $authenticator = array(
            'identifier' => $this->networkId,
            'time' => $signature->getRequestTime(),
            'hash' => $signature->generate($params),
            'nonce' => $signature->getNonce(),
        );

        return $authenticator;
    }
665971
protected function generateOauthSignature($parameters)
    {
        $baseRequestUri = \rawurlencode($this->url);

        // Extract filters.
        $parameters = $this->processFilters($parameters);

        // Normalize parameter key/values and sort them.
        $parameters = $this->normalizeParameters($parameters);
        \uksort($parameters, 'strcmp');

        // Set query string.
        $queryString  = \implode('%26', $this->joinWithEqualsSign($parameters)); // Join with ampersand.
        $stringToSign = $this->method . '&' . $baseRequestUri . '&' . $queryString;
        $secret       = $this->getSecret();

        return \base64_encode(\hash_hmac(self::HASH_ALGORITHM, $stringToSign, $secret, true));
    }
940336
private function createHeader($parameters)
	{
		$header = 'OAuth ';

		foreach ($parameters as $key => $value)
		{
			if (!strcmp($header, 'OAuth '))
			{
				$header .= $key . '="' . $this->safeEncode($value) . '"';
			}
			else
			{
				$header .= ', ' . $key . '="' . $value . '"';
			}
		}

		return $header;
	}
1275066
public static function getModelEquation(array $params): string
    {
        return sprintf('y = %fx/(%f+x)', $params[self::$V], $params[self::$K]);
    }
628697
public function verifyCallbackRequest(array $params)
    {
        return $this->signatureCallback
            ->setOrderId(array_get($params, 'Order_ID'))
            ->setStatus(array_get($params, 'Status'))
            ->setFields(array_except($params, ['Order_ID', 'Status', 'Signature']))
            ->setPassword($this->getPassword())
            ->verify(array_get($params, 'Signature'));
    }
968731
public function getHrefWithDoAppend(array $params): string
    {
        $href = [];
        $href[] = static::makeParam('p', $this->p);
        $href[] = $this->parseParameter('do', $this->do == '_default' ? '' : $this->do, $params);

        foreach ($params as $key => $value) {
            $href[] = static::makeParam($key, $value);
        }

        return '?' . implode('&', $href);
    }
682241
private function createSignatureDataFromHeaders(array $headers)
    {
        $signatureData = '';

        foreach ($headers as $header => $values) {
            foreach ($values as $value) {
                if ($header === 'User-Agent'
                    || $header === 'Cache-Control'
                    || substr($header, 0, 7) === 'X-Bunq-'
                ) {
                    $signatureData .= PHP_EOL . $header . ': ' . $value;
                }
            }
        }

        return $signatureData;
    }
400317
protected function generateSign(array $params_wait_to_sign)
    {
        // 1.
        $sorted = [];
        foreach ($params_wait_to_sign as $key => $item) {
            if (! empty($item)) {
                $sorted[$key] = $item;
            }
        }
        ksort($sorted);

        // 2.
        $decoded_query_string = urldecode(http_build_query($sorted));

        // 3.
        $sign = self::signature($decoded_query_string);

        return $sign;
    }
160066
protected function serializeParams(array $params)
    {
        $serialized = array();
        foreach ($params as $param) {
            $serialized[] = $this->serializer->serialize($param);
        }

        return $serialized;
    }
1131947
protected function generateSign($params)
    {
        ksort($params);
        $stringToSign = 'GET&%2F&' . urlencode(http_build_query($params, null, '&', PHP_QUERY_RFC3986));
        return base64_encode(hash_hmac('sha1', $stringToSign, $this->accessKey . '&', true));
    }
209383
private function signature(array $params)
    {
        ksort($params);
        $accessKeySecret = $this->config['access_key_secret'];
        $stringToSign = 'POST&%2F&' . urlencode(http_build_query($params, null, '&', PHP_QUERY_RFC3986));
        return base64_encode(hash_hmac('sha1', $stringToSign, $accessKeySecret . '&', true));
    }
1027899
protected function _params2string($params)
    {
        if (!count($params)) {
            return '';
        }
        $paramsPart = array();
        foreach ($params as $name => $value) {
            if (!$value && ('0' !== $value)) {
                continue;
            }
            $paramsPart[] = str_replace(array('{name}', '{value}'), array($name, urlencode($value)), $this->paramsPairStructure);
        }
        if (!count($paramsPart)) {
            return '';
        }
        return '/' . implode($this->paramsSeparator, $paramsPart);
    }
430957
public static function getToken($params = null)
    {
        if (!$params) {
            $params = array();
        }
        $requestor = new ApiRequestor(Sumup::$connectBase, true);
        $params['client_id'] = self::_getConnectParam('client_id', $params);
        $params['client_secret'] = self::_getConnectParam('client_secret', $params);
        $response = $requestor->request('post', '/token', $params);

        if ($response->raw->getStatusCode() !== 200) {
            throw new Error\AuthenticationError('Token request error');
        }

        return new AccessToken($response);
    }
269447
public function generate($method, $url, array $data = [], array $headers = [], $basicAuthCredentials = '')
    {
        $signatureParts = [$method, $url];
        $signatureParts[] = http_build_query($data);
        $signatureParts[] = http_build_query($headers);
        $signatureParts[] = $basicAuthCredentials;

        return implode('|', $signatureParts);
    }
726883
protected function generateSignature($params, $secret) {
    // Work with sorted data.
    ksort($params);

    // Generate the base string.
    $base_string = '';
    foreach ($params as $key => $value) {
      $base_string .= $key . '=' . $value;
    }
    $base_string .= $secret;

    return md5($base_string);
  }
980711
function getSignature(array $params, $method = null)
    {
        ksort($params);
        unset($params['sign']);
        unset($params['signature']);
        array_push($params, $this->secretKey);

        if ($method) {
            array_unshift($params, $method);
        }

        return hash('sha256', join('{up}', $params));
    }