41 references to Base64
Microsoft.Extensions.AI.Abstractions (2)
Contents\DataContent.cs (1)
286"data:".Length + MediaType.Length + ";base64,".Length + Base64.GetMaxEncodedToUtf8Length(data.Length));
Contents\DataUriParser.cs (1)
149return Base64.IsValid(value) && !value.ContainsAny(" \t\r\n");
Microsoft.ML.Tokenizers (1)
Utils\Helpers.netcoreapp.cs (1)
38if (!Base64.IsValid(base64String.AsSpan(offset, length), out int decodedLength))
Microsoft.ML.Tokenizers.Tests (1)
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (1)
38if (!Base64.IsValid(base64String.AsSpan(offset, length), out int decodedLength))
Microsoft.Net.Http.Headers (2)
ContentDispositionHeaderValue.cs (2)
547Base64.GetMaxEncodedToUtf8Length(Encoding.UTF8.GetByteCount(input.AsSpan())) + 559Base64.EncodeToUtf8InPlace(bufferContent, contentLength, out var base64ContentLength);
mscorlib (1)
mscorlib.cs (1)
50[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Base64))]
netstandard (1)
netstandard.cs (1)
77[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Base64))]
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\Base64StringAttribute.cs (1)
48return Base64.IsValid(valueAsString);
System.Memory (1)
artifacts\obj\System.Memory\Debug\net11.0\System.Memory.Forwards.cs (1)
10[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Base64))]
System.Private.CoreLib (12)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (2)
1400public int GetMaxDecodedLength(int utf8Length) => Base64.GetMaxDecodedFromUtf8Length(utf8Length); 1621public int GetMaxDecodedLength(int sourceLength) => Base64.GetMaxDecodedFromUtf8Length(sourceLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64EncoderHelper.cs (2)
724srcLength <= MaximumEncodeLength && destLength >= Base64.GetMaxEncodedToUtf8Length(srcLength) ? 729public int GetMaxEncodedLength(int srcLength) => Base64.GetMaxEncodedToUtf8Length(srcLength);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (8)
2316return Base64.EncodeToString(inArray); 2358return Base64.EncodeToString(bytes); 2404int charsWritten = Base64.EncodeToChars(new ReadOnlySpan<byte>(inArray, offsetIn, length), outArray.AsSpan(offsetOut)); 2440int written = Base64.EncodeToChars(bytes, chars); 2463OperationStatus status = Base64.EncodeToChars(source.Slice(0, chunkSize), destination.Slice(writeOffset), out int bytesConsumed, out int charsWritten); 2521return Base64.DecodeFromChars(s); 2536OperationStatus status = Base64.DecodeFromChars(chars, bytes, out _, out bytesWritten); 2560return Base64.DecodeFromChars(new ReadOnlySpan<char>(inArray, offset, length));
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
64[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.Text.Base64))]
System.Security.Cryptography (7)
System\Security\Cryptography\Base64Transforms.cs (4)
51OperationStatus status = Base64.EncodeToUtf8(input, output, out int consumed, out int written, isFinalBlock: false); 76OperationStatus status = Base64.EncodeToUtf8(input, output, out int consumed, out int written, isFinalBlock: true); 272int outputSize = Base64.GetMaxDecodedFromUtf8Length(bytesToTransform); 304OperationStatus status = Base64.DecodeFromUtf8(transformBuffer, outputBuffer, out consumed, out written);
System\Security\Cryptography\PemEncoding.cs (3)
748return Base64.IsValid(base64Text, out decodedLength); 775return Base64.IsValid(base64Text, out decodedLength); 780OperationStatus status = Base64.EncodeToUtf8(
System.Text.Json (11)
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (2)
208OperationStatus status = Base64.DecodeFromUtf8InPlace(utf8Unescaped, out int bytesWritten); 226OperationStatus status = Base64.DecodeFromUtf8(utf8Unescaped, byteSpan, out int bytesConsumed, out int bytesWritten);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (4)
208int encodedLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length); 243int encodedLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length); 282int encodedLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length); 332int encodedLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (2)
61int encodingLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length); 104int encodingLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (1)
131OperationStatus status = Base64.EncodeToUtf8(bytes, destination, out int consumed, out int written);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (2)
361if (value.Length > Base64.GetMaxDecodedFromUtf8Length(int.MaxValue)) 447int requiredBytes = Base64.GetMaxEncodedToUtf8Length(bytes.Length);