Share via


Base64UrlEncoder Class

Definition

Encodes and Decodes strings as base64url encoding.

public static class Base64UrlEncoder
type Base64UrlEncoder = class
Public Class Base64UrlEncoder
Inheritance
Base64UrlEncoder

Methods

Decode(String)

Decodes the specified base64url encoded string to UTF-8.

DecodeBytes(String)

Converts the specified base64url encoded string to UTF-8 bytes.

Encode(Byte[])

Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation encoded with base64url digits.

Encode(Byte[], Int32, Int32)

Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation encoded with base64url digits. Parameters specify the subset as an offset in the input array and the number of elements in the array to convert.

Encode(ReadOnlySpan<Byte>, Span<Char>)

Populates a Span<T> with the base64url encoded representation of a ReadOnlySpan<T> of bytes.

Encode(String)

Performs base64url encoding, which differs from regular base64 encoding as follows:

  • Padding is skipped so the pad character '=' doesn't have to be percent encoded.
  • The 62nd and 63rd regular base64 encoding characters ('+' and '/') are replaced with ('-' and '_'). This makes the encoding alphabet URL safe.

Applies to