public static function encode($arg)
    {
        $s = base64_encode($arg); // Standard base64 encoder

        $s = explode('=', $s)[0]; // Remove any trailing '='s
        $s = str_replace('+', '-', $s); // 62nd char of encoding
        $s = str_replace('/', '_', $s); //63rd char of encoding

        return $s;
    }