Edit

Share via


Base64Url.EncodeToChars Method

Definition

Overloads

EncodeToChars(ReadOnlySpan<Byte>)

Encodes the span of binary data into unicode ASCII chars represented as Base64Url.

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

Encodes the span of binary data into unicode ASCII chars represented as Base64Url.

EncodeToChars(ReadOnlySpan<Byte>, Span<Char>, Int32, Int32, Boolean)

Encodes the span of binary data into unicode ASCII chars represented as Base64Url.

EncodeToChars(ReadOnlySpan<Byte>)

Source:
Base64UrlEncoder.cs

Encodes the span of binary data into unicode ASCII chars represented as Base64Url.

public:
 static cli::array <char> ^ EncodeToChars(ReadOnlySpan<System::Byte> source);
public static char[] EncodeToChars (ReadOnlySpan<byte> source);
static member EncodeToChars : ReadOnlySpan<byte> -> char[]
Public Shared Function EncodeToChars (source As ReadOnlySpan(Of Byte)) As Char()

Parameters

source
ReadOnlySpan<Byte>

The input span which contains binary data that needs to be encoded.

Returns

Char[]

A char array which contains the result of the operation, i.e. the ASCII chars in Base64Url.

Remarks

This implementation of the base64url encoding omits the optional padding characters.

Applies to

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

Source:
Base64UrlEncoder.cs

Encodes the span of binary data into unicode ASCII chars represented as Base64Url.

public:
 static int EncodeToChars(ReadOnlySpan<System::Byte> source, Span<char> destination);
public static int EncodeToChars (ReadOnlySpan<byte> source, Span<char> destination);
static member EncodeToChars : ReadOnlySpan<byte> * Span<char> -> int
Public Shared Function EncodeToChars (source As ReadOnlySpan(Of Byte), destination As Span(Of Char)) As Integer

Parameters

source
ReadOnlySpan<Byte>

The input span which contains binary data that needs to be encoded.

destination
Span<Char>

The output span which contains the result of the operation, i.e. the ASCII chars in Base64Url.

Returns

The number of bytes written into the destination span. This can be used to slice the output for subsequent calls, if necessary.

Exceptions

The buffer in destination is too small to hold the encoded output.

Remarks

This implementation of the base64url encoding omits the optional padding characters.

Applies to

EncodeToChars(ReadOnlySpan<Byte>, Span<Char>, Int32, Int32, Boolean)

Source:
Base64UrlEncoder.cs

Encodes the span of binary data into unicode ASCII chars represented as Base64Url.

public static System.Buffers.OperationStatus EncodeToChars (ReadOnlySpan<byte> source, Span<char> destination, out int bytesConsumed, out int charsWritten, bool isFinalBlock = true);
static member EncodeToChars : ReadOnlySpan<byte> * Span<char> * int * int * bool -> System.Buffers.OperationStatus
Public Shared Function EncodeToChars (source As ReadOnlySpan(Of Byte), destination As Span(Of Char), ByRef bytesConsumed As Integer, ByRef charsWritten As Integer, Optional isFinalBlock As Boolean = true) As OperationStatus

Parameters

source
ReadOnlySpan<Byte>

The input span which contains binary data that needs to be encoded.

destination
Span<Char>

The output span which contains the result of the operation, i.e. the ASCII chars in Base64Url.

bytesConsumed
Int32

>When this method returns, contains the number of input bytes consumed during the operation. This can be used to slice the input for subsequent calls, if necessary. This parameter is treated as uninitialized.

charsWritten
Int32

>When this method returns, contains the number of chars written into the output span. This can be used to slice the output for subsequent calls, if necessary. This parameter is treated as uninitialized.

isFinalBlock
Boolean

true when the input span contains the entirety of data to encode; false when more data may follow,

such as when calling in a loop, subsequent calls with false should end with true call. The default is true.

Returns

One of the enumeration values that indicates the success or failure of the operation.

Remarks

This implementation of the base64url encoding omits the optional padding characters.

Applies to