I\'m looking for a (fast) standard implementation for base64url according to RFC4648 in C#.
I found HttpServerUtility.UrlTokenEncode but it looks like this doesn\'t
Based on the comments, it sounds like System.Web.HttpServerUtility.UrlTokenEncode
does the right thing except for the extra character for padding. So you should be able to do:
string customBase64 = HttpServerUtility.UrlTokenEncode(data);
string rfc4648 = customBase64.Substring(0, customBase64.Length - 1);
However, you should add unit tests to check that it really does use the RFC 4648 alphabet (and in the same way as RFC 4648). It's somewhat surprising that the docs are so sparse :(