Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsValidLabel()

static bool System.Security.Cryptography.PemEncoding.IsValidLabel ( ReadOnlySpan< char > data)
inlinestaticprivate

Definition at line 96 of file PemEncoding.cs.

97 {
98 if (data.IsEmpty)
99 {
100 return true;
101 }
102 bool flag = false;
103 for (int i = 0; i < data.Length; i++)
104 {
105 char c2 = data[i];
106 if (IsLabelChar(c2))
107 {
108 flag = true;
109 continue;
110 }
111 if ((c2 != ' ' && c2 != '-') || !flag)
112 {
113 return false;
114 }
115 flag = false;
116 }
117 return flag;
118 static bool IsLabelChar(char c)
119 {
120 if ((uint)(c - 33) <= 93u)
121 {
122 return c != '-';
123 }
124 return false;
125 }
126 }

References System.ReadOnlySpan< T >.IsEmpty, and System.ReadOnlySpan< T >.Length.

Referenced by System.Security.Cryptography.PemEncoding.TryFind(), System.Security.Cryptography.PemEncoding.TryWrite(), and System.Security.Cryptography.PemEncoding.Write().