Edit

Share via


Base64Url.IsValid Method

Definition

Overloads

IsValid(ReadOnlySpan<Byte>)

Validates that the specified span of UTF-8 text is comprised of valid base-64 encoded data.

IsValid(ReadOnlySpan<Char>)

Validates that the specified span of text is comprised of valid base-64 encoded data.

IsValid(ReadOnlySpan<Byte>, Int32)

Validates that the specified span of UTF-8 text is comprised of valid base-64 encoded data.

IsValid(ReadOnlySpan<Char>, Int32)

Validates that the specified span of text is comprised of valid base-64 encoded data.

IsValid(ReadOnlySpan<Byte>)

Source:
Base64UrlValidator.cs

Validates that the specified span of UTF-8 text is comprised of valid base-64 encoded data.

public:
 static bool IsValid(ReadOnlySpan<System::Byte> utf8Base64UrlText);
public static bool IsValid (ReadOnlySpan<byte> utf8Base64UrlText);
static member IsValid : ReadOnlySpan<byte> -> bool
Public Shared Function IsValid (utf8Base64UrlText As ReadOnlySpan(Of Byte)) As Boolean

Parameters

utf8Base64UrlText
ReadOnlySpan<Byte>

A span of UTF-8 text to validate.

Returns

true if utf8Base64UrlText contains a valid, decodable sequence of base-64 encoded data; otherwise, false.

Remarks

where whitespace is defined as the characters ' ', '\t', '\r', or '\n' (as bytes).

Applies to

IsValid(ReadOnlySpan<Char>)

Source:
Base64UrlValidator.cs

Validates that the specified span of text is comprised of valid base-64 encoded data.

public:
 static bool IsValid(ReadOnlySpan<char> base64UrlText);
public static bool IsValid (ReadOnlySpan<char> base64UrlText);
static member IsValid : ReadOnlySpan<char> -> bool
Public Shared Function IsValid (base64UrlText As ReadOnlySpan(Of Char)) As Boolean

Parameters

base64UrlText
ReadOnlySpan<Char>

A span of text to validate.

Returns

true if base64UrlText contains a valid, decodable sequence of base-64 encoded data; otherwise, false.

Remarks

If the method returns true, the same text passed to DecodeFromChars(ReadOnlySpan<Char>) and

TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) would successfully decode (in the case

of TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) assuming sufficient output space).

Any amount of whitespace is allowed anywhere in the input, where whitespace is defined as the characters ' ', '\t', '\r', or '\n'.

Applies to

IsValid(ReadOnlySpan<Byte>, Int32)

Source:
Base64UrlValidator.cs

Validates that the specified span of UTF-8 text is comprised of valid base-64 encoded data.

public:
 static bool IsValid(ReadOnlySpan<System::Byte> utf8Base64UrlText, [Runtime::InteropServices::Out] int % decodedLength);
public static bool IsValid (ReadOnlySpan<byte> utf8Base64UrlText, out int decodedLength);
static member IsValid : ReadOnlySpan<byte> * int -> bool
Public Shared Function IsValid (utf8Base64UrlText As ReadOnlySpan(Of Byte), ByRef decodedLength As Integer) As Boolean

Parameters

utf8Base64UrlText
ReadOnlySpan<Byte>

A span of UTF-8 text to validate.

decodedLength
Int32

If the method returns true, the number of decoded bytes that will result from decoding the input UTF-8 text.

Returns

true if utf8Base64UrlText contains a valid, decodable sequence of base-64 encoded data; otherwise, false.

Remarks

where whitespace is defined as the characters ' ', '\t', '\r', or '\n' (as bytes).

Applies to

IsValid(ReadOnlySpan<Char>, Int32)

Source:
Base64UrlValidator.cs

Validates that the specified span of text is comprised of valid base-64 encoded data.

public:
 static bool IsValid(ReadOnlySpan<char> base64UrlText, [Runtime::InteropServices::Out] int % decodedLength);
public static bool IsValid (ReadOnlySpan<char> base64UrlText, out int decodedLength);
static member IsValid : ReadOnlySpan<char> * int -> bool
Public Shared Function IsValid (base64UrlText As ReadOnlySpan(Of Char), ByRef decodedLength As Integer) As Boolean

Parameters

base64UrlText
ReadOnlySpan<Char>

A span of text to validate.

decodedLength
Int32

If the method returns true, the number of decoded bytes that will result from decoding the input text.

Returns

true if base64UrlText contains a valid, decodable sequence of base-64 encoded data; otherwise, false.

Remarks

If the method returns true, the same text passed to DecodeFromChars(ReadOnlySpan<Char>) and

TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) would successfully decode (in the case

of TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) assuming sufficient output space).

Any amount of whitespace is allowed anywhere in the input, where whitespace is defined as the characters ' ', '\t', '\r', or '\n'.

Applies to