Base64Url.IsValid 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| IsValid(ReadOnlySpan<Byte>) |
驗證指定的 UTF-8 文字區段是否包含有效的 base-64 編碼資料。 |
| IsValid(ReadOnlySpan<Char>) |
驗證指定的文字區段是否包含有效的 base-64 編碼資料。 |
| IsValid(ReadOnlySpan<Byte>, Int32) |
驗證指定的 UTF-8 文字區段是否包含有效的 base-64 編碼資料。 |
| IsValid(ReadOnlySpan<Char>, Int32) |
驗證指定的文字區段是否包含有效的 base-64 編碼資料。 |
IsValid(ReadOnlySpan<Byte>)
驗證指定的 UTF-8 文字區段是否包含有效的 base-64 編碼資料。
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
參數
- utf8Base64UrlText
- ReadOnlySpan<Byte>
一組 UTF-8 文字用於驗證。
傳回
true 若 utf8Base64UrlText 包含有效且可解碼的 64 進位編碼資料序列;否則, false。
備註
其中空白位定義為字元「' '、'\t'、'\r'或 '\n'(以位元組表示)。
適用於
IsValid(ReadOnlySpan<Char>)
驗證指定的文字區段是否包含有效的 base-64 編碼資料。
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
參數
- base64UrlText
- ReadOnlySpan<Char>
一段文字來驗證。
傳回
true 若 base64UrlText 包含有效且可解碼的 64 進位編碼資料序列;否則, false。
備註
若方法返回 true,則相同文字傳遞至 DecodeFromChars(ReadOnlySpan<Char>) 與
TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) 會成功解碼(在
假設 TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) 輸出空間足夠)。
輸入中允許任意空白,空白定義為字元「'」、「\t」、「\r」或「\n」。
適用於
IsValid(ReadOnlySpan<Byte>, Int32)
驗證指定的 UTF-8 文字區段是否包含有效的 base-64 編碼資料。
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
參數
- utf8Base64UrlText
- ReadOnlySpan<Byte>
一組 UTF-8 文字用於驗證。
- decodedLength
- Int32
若方法回傳 true,則為解碼輸入 UTF-8 文字所產生的解碼位元組數。
傳回
true 若 utf8Base64UrlText 包含有效且可解碼的 64 進位編碼資料序列;否則, false。
備註
其中空白位定義為字元「' '、'\t'、'\r'或 '\n'(以位元組表示)。
適用於
IsValid(ReadOnlySpan<Char>, Int32)
驗證指定的文字區段是否包含有效的 base-64 編碼資料。
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
參數
- base64UrlText
- ReadOnlySpan<Char>
一段文字來驗證。
- decodedLength
- Int32
若方法回傳 true,則為解碼輸入文字所產生的解碼位元組數。
傳回
true 若 base64UrlText 包含有效且可解碼的 64 進位編碼資料序列;否則, false。
備註
若方法返回 true,則相同文字傳遞至 DecodeFromChars(ReadOnlySpan<Char>) 與
TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) 會成功解碼(在
假設 TryDecodeFromChars(ReadOnlySpan<Char>, Span<Byte>, Int32) 輸出空間足夠)。
輸入中允許任意空白,空白定義為字元「'」、「\t」、「\r」或「\n」。