HttpServerUtility.UrlTokenEncode replacement for netstandard : <p>I'm porting a project targeting <code>net472</code> to <code>netstandard</code>. The last <code>System.Web</code> dependency I'm stuck with is <a href="https://docs.microsoft.com/en-us/dotnet/api/system.web.httpserverutility.urltokenencode?view=netframework-4.7.2#System_Web_HttpServerUtility_UrlTokenEncode_System_Byte___" rel="noreferrer"><code>HttpServerUtility.UrlTokenEncode(Byte[])</code></a>.</p>

<p>I found <a href="https://fuget.org/packages/Microsoft.AspNetCore.WebUtilities/2.1.0/lib/netstandard2.0/Microsoft.AspNetCore.WebUtilities.dll/Microsoft.AspNetCore.WebUtilities" rel="noreferrer"><code>Microsoft.AspNetCore.WebUtilities</code></a>, which contains <a href="https://fuget.org/packages/Microsoft.AspNetCore.WebUtilities/2.1.0/lib/netstandard2.0/Microsoft.AspNetCore.WebUtilities.dll/Microsoft.AspNetCore.WebUtilities/Base64UrlTextEncoder" rel="noreferrer"><code>Base64UrlTextEncoder</code></a> and <a href="https://fuget.org/packages/Microsoft.AspNetCore.WebUtilities/2.1.0/lib/netstandard2.0/Microsoft.AspNetCore.WebUtilities.dll/Microsoft.AspNetCore.WebUtilities/WebEncoders" rel="noreferrer"><code>WebEncoders</code></a>, but those are not interchangeable with the <code>UrlTokenEncode</code>/<code>Decode</code>, as it appends / expects the number of <a href="https://stackoverflow.com/q/6916805/155005"><code>=</code> padding characters</a> at the end, e.g.:</p>

<pre><code>var data = Encoding.UTF8.GetBytes("SO");
Convert.ToBase64String(data);              // U08=
HttpServerUtility.UrlTokenEncode(data);    // U081 - this is what's expected and 
                                           // the only thing UrlTokenDecode can handle
Base64UrlTextEncoder.Encode(data);         // U08
WebEncoders.Base64UrlEncode(data);         // U08
</code></pre>

<p>As far as I can tell, there are no other differences (I ran tests with random strings), but it also pulls in some other dependencies (Microsoft.Net.Http.Headers &amp; Microsoft.Extensions.Primitives), that I don't really need in that project.</p>

<p>Is there any nuget package with a drop-in replacement? I'm thinking of implementing this myself, if not.</p>
