public static function base64UrlSafeEncode($s)
    {
        $s = base64_encode($s);
        $s = str_replace('+', '-', $s);
        $s = str_replace('/', '_', $s);
        $s = str_replace('=', '', $s);
        return ($s);
    }