Base64Encode(ReadOnlySpan`1Byte, Base64FormattingOptions) Method

Converts a read-only Byte span to a corresponding Base64-encoded string. Optional you can determine, whether line breaks are to be inserted into the return value.

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
C#
public static string Encode(
	ReadOnlySpan<byte> bytes,
	Base64FormattingOptions options = Base64FormattingOptions.None
)

Parameters

bytes  ReadOnlySpanByte
A read-only Byte span that contains the data to encode.
options  Base64FormattingOptions  (Optional)
One of the enumeration values, which specify whether or not line breaks are to be inserted into the return value. The default is None.

Return Value

String
The Base64 string reprensentation of the elements in bytes.

Remarks

Exceptions

ArgumentExceptionoptions is not a defined Base64FormattingOptions value.
OutOfMemoryExceptionThe output length was greater than Int32.MaxValue.

See Also