src/includes/classes/Core/Utils/UrlQuery.php
protected function sha256Sig(string $qs_url_uri, string $key = '', string $sig_var = ''): string
    {
        if (!$key && !($key = $this->App->Config->©urls['©sig_key'])) {
            throw $this->c::issue('Missing URL signature key.');
        }
        $sig_var = $sig_var ?: $this::DEFAULT_SIG_VAR;
        $args    = $this->parse($qs_url_uri);
        unset($args[$sig_var]); // Exclude.

        $args            = $this->c::mbTrim($args);
        $args            = $this->c::sortByKey($args);
        $serialized_args = serialize($args); // After sorting by key.
        $sig             = $this->c::sha256KeyedHash($serialized_args, $key);

        return $sig; // Signature.
    }
protected function sha256Sig(string $qs_url_uri, string $key = '', string $sig_var = ''): string
    {
        if (!$key && !($key = $this->App->Config->©urls['©sig_key'])) {
            throw $this->c::issue('Missing URL signature key.');
        }
        $sig_var = $sig_var ?: $this::DEFAULT_SIG_VAR;
        $args    = $this->parse($qs_url_uri);
        unset($args[$sig_var]); // Exclude.

        $args            = $this->c::mbTrim($args);
        $args            = $this->c::sortByKey($args);
        $serialized_args = serialize($args); // After sorting by key.
        $sig             = $this->c::sha256KeyedHash($serialized_args, $key);

        return $sig; // Signature.
    }
Builds a keyed SHA-256 signature.

@since 150424 Initial release.

@param string $qs_url_uri A query string (w/ or w/o a leading `?`), a URL, or URI.
@param string $key        Encryption key (optional).
@param string $sig_var    Defaults to `sig`.

@return string SHA-256 signature string.