public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string
    {
        $aUrl = parse_url($sUrlToSign);
        $aUrl['query'] .= '&client=' .$sClientId;

        $aUrlToSign = $aUrl['path']."?".$aUrl['query'];

        $decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey));

        $sSignature = hash_hmac("sha1", $aUrlToSign, $decodedKey, true);

        $sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature));

        $sOriginalUrl = $aUrl['scheme']."://".$aUrl['host'].$aUrl['path'] . "?".$aUrl['query'];

        return $sOriginalUrl. '&signature='. $sEncodedSignature;
    }