488 references to AsSpan
Aspire.Dashboard (1)
Otlp\Model\OtlpHelpers.cs (1)
280parentAttributes.AsSpan().CopyTo(copiedAttributes);
dotnet-dev-certs (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
http2cat (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
188var buffer = _headerEncodingBuffer.AsSpan(); 289var buffer = _headerEncodingBuffer.AsSpan(); 329var buffer = _headerEncodingBuffer.AsSpan(); 373var buffer = _headerEncodingBuffer.AsSpan(); 735var payload = new byte[priorityFrame.PayloadLength].AsSpan();
IIS.FunctionalTests (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
188var buffer = _headerEncodingBuffer.AsSpan(); 289var buffer = _headerEncodingBuffer.AsSpan(); 329var buffer = _headerEncodingBuffer.AsSpan(); 373var buffer = _headerEncodingBuffer.AsSpan(); 735var payload = new byte[priorityFrame.PayloadLength].AsSpan();
IIS.LongTests (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
188var buffer = _headerEncodingBuffer.AsSpan(); 289var buffer = _headerEncodingBuffer.AsSpan(); 329var buffer = _headerEncodingBuffer.AsSpan(); 373var buffer = _headerEncodingBuffer.AsSpan(); 735var payload = new byte[priorityFrame.PayloadLength].AsSpan();
IIS.NewHandler.FunctionalTests (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
188var buffer = _headerEncodingBuffer.AsSpan(); 289var buffer = _headerEncodingBuffer.AsSpan(); 329var buffer = _headerEncodingBuffer.AsSpan(); 373var buffer = _headerEncodingBuffer.AsSpan(); 735var payload = new byte[priorityFrame.PayloadLength].AsSpan();
IIS.NewShim.FunctionalTests (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
188var buffer = _headerEncodingBuffer.AsSpan(); 289var buffer = _headerEncodingBuffer.AsSpan(); 329var buffer = _headerEncodingBuffer.AsSpan(); 373var buffer = _headerEncodingBuffer.AsSpan(); 735var payload = new byte[priorityFrame.PayloadLength].AsSpan();
IISExpress.FunctionalTests (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
188var buffer = _headerEncodingBuffer.AsSpan(); 289var buffer = _headerEncodingBuffer.AsSpan(); 329var buffer = _headerEncodingBuffer.AsSpan(); 373var buffer = _headerEncodingBuffer.AsSpan(); 735var payload = new byte[priorityFrame.PayloadLength].AsSpan();
InMemory.FunctionalTests (30)
Http2\Http2ConnectionTests.cs (13)
792Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 820Assert.True(_maxData.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 917Assert.True(_maxData.AsSpan().SequenceEqual(frame.PayloadSequence.ToArray())); 986Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 1050Assert.True(_helloBytes.AsSpan().SequenceEqual(stream1DataFrame1.PayloadSequence.ToArray())); 1051Assert.True(_worldBytes.AsSpan().SequenceEqual(stream1DataFrame2.PayloadSequence.ToArray())); 1052Assert.True(_helloBytes.AsSpan().SequenceEqual(stream3DataFrame1.PayloadSequence.ToArray())); 1053Assert.True(_worldBytes.AsSpan().SequenceEqual(stream3DataFrame2.PayloadSequence.ToArray())); 1165Assert.True(_maxData.AsSpan().SequenceEqual(frame.PayloadSequence.ToArray())); 1270Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 1340Assert.True(_maxData.AsSpan().SequenceEqual(dataFrame3.PayloadSequence.ToArray())); 1475Assert.True(_maxData.AsSpan().SequenceEqual(frame.PayloadSequence.ToArray())); 2084data.AsSpan().Fill(1);
Http2\Http2StreamTests.cs (12)
1626Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 1744Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 3552headersFrame.PayloadSequence.CopyTo(temp.AsSpan()); 3589headersFrame.PayloadSequence.CopyTo(temp.AsSpan()); 3702headersFrame.PayloadSequence.CopyTo(temp.AsSpan()); 3739headersFrame.PayloadSequence.CopyTo(temp.AsSpan()); 3908Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 3954Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 4105Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 4155Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 4200Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame.PayloadSequence.ToArray())); 5896Assert.True(_helloWorldBytes.AsSpan().SequenceEqual(dataFrame1.PayloadSequence.ToArray()));
Http2\Http2TestBase.cs (4)
660var buffer = _headerEncodingBuffer.AsSpan(); 702var buffer = _headerEncodingBuffer.AsSpan(); 748var buffer = _headerEncodingBuffer.AsSpan(); 1117var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
36var buffer = headerEncodingBuffer.AsSpan();
Microsoft.AspNetCore.Components.Server (2)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (1)
728this.Write(src.AsSpan());
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\KeyRingBasedDataProtector.cs (1)
385var targetSpan = targetArr.AsSpan();
Managed\ManagedAuthenticatedEncryptor.cs (1)
380var outputSpan = outputArray.AsSpan();
Microsoft.AspNetCore.DataProtection.Tests (3)
Cng\CbcAuthenticatedEncryptorTests.cs (1)
32Assert.Equal(plaintext.AsSpan(), decipheredtext.AsSpan());
Cng\GcmAuthenticatedEncryptorTests.cs (1)
29Assert.Equal(plaintext.AsSpan(), decipheredtext.AsSpan());
Managed\ManagedAuthenticatedEncryptorTests.cs (1)
28Assert.Equal(plaintext.AsSpan(), decipheredtext.AsSpan());
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Microsoft.AspNetCore.Http.Extensions (1)
src\Shared\PropertyAsParameterInfo.cs (1)
137return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\Shared\PropertyAsParameterInfo.cs (1)
137return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Mvc.TagHelpers (1)
GlobbingUrlBuilder.cs (1)
308return ValidAttributeWhitespaceChars.AsSpan().IndexOf(ch) != -1;
Microsoft.AspNetCore.OpenApi (1)
src\Shared\PropertyAsParameterInfo.cs (1)
137return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Routing.Tests (8)
Matching\DfaMatcherTest.cs (8)
372var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 399var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 426var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 453var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 478var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 504var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 531var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 558var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
src\Shared\Http2cat\Http2Utilities.cs (5)
188var buffer = _headerEncodingBuffer.AsSpan(); 289var buffer = _headerEncodingBuffer.AsSpan(); 329var buffer = _headerEncodingBuffer.AsSpan(); 373var buffer = _headerEncodingBuffer.AsSpan(); 735var payload = new byte[priorityFrame.PayloadLength].AsSpan();
Microsoft.AspNetCore.Server.IIS (1)
Core\IO\AsyncWriteOperationBase.cs (1)
77_handles.AsSpan().Clear();
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (26)
HttpRequestHeadersTests.cs (19)
545headerValueUtf16Latin1CrossOver = new string(headerValue.AsSpan().Slice(0, i + 1)); 550var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 551var prevSpan = Encoding.UTF8.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 564var headerNameBytes = Encoding.ASCII.GetBytes((string)headerName).AsSpan(); 565var nextSpan = Encoding.Latin1.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 606headerValueUtf16Latin1CrossOver = new string(headerValue.AsSpan().Slice(0, i + 1)); 609var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 610var latinValueSpan = Encoding.Latin1.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 656var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 657var valueSpan = Encoding.ASCII.GetBytes(valueString).AsSpan(); 747var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 748var prevSpan = Encoding.UTF8.GetBytes(HeaderValue).AsSpan(); 795var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 796var prevSpan1 = Encoding.UTF8.GetBytes(HeaderValue1).AsSpan(); 797var prevSpan2 = Encoding.UTF8.GetBytes(HeaderValue2).AsSpan(); 849var headerName = Encoding.ASCII.GetBytes(prevName).AsSpan(); 850var prevSpan = Encoding.UTF8.GetBytes(prevValue).AsSpan(); 860headerName = Encoding.ASCII.GetBytes(prevName).AsSpan(); 861var nextSpan = Encoding.UTF8.GetBytes(nextValue).AsSpan();
HttpUtilitiesTest.cs (2)
250HttpUtilities.GetRequestHeaderString(encodedBytes.AsSpan(), HeaderNames.Accept, selector, checkForNewlineChars: true)); 258HttpUtilities.GetRequestHeaderString(encodedBytes.AsSpan(), HeaderNames.Accept, selector, checkForNewlineChars: false);
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
36var buffer = headerEncodingBuffer.AsSpan();
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (2)
157Assert.True(expectedData.AsSpan().SequenceEqual(dynamicField.Name)); 158Assert.True(expectedData.AsSpan().SequenceEqual(dynamicField.Value));
UTF8Decoding.cs (2)
21var s = HttpUtilities.GetRequestHeaderString(encodedBytes.AsSpan(), HeaderNames.Accept, KestrelServerOptions.DefaultHeaderEncodingSelector, checkForNewlineChars: false); 40HttpUtilities.GetRequestHeaderString(byteRange.AsSpan(), HeaderNames.Accept, KestrelServerOptions.DefaultHeaderEncodingSelector, checkForNewlineChars: false));
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
BinaryPrimitivesBenchmark.cs (1)
39v = BinaryPrimitives.ReadUInt32BigEndian(_data.AsSpan());
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
36var buffer = headerEncodingBuffer.AsSpan();
Microsoft.AspNetCore.Shared.Tests (26)
runtime\Http2\DynamicTableTest.cs (4)
157Assert.True(expectedData.AsSpan().SequenceEqual(dynamicField.Name)); 158Assert.True(expectedData.AsSpan().SequenceEqual(dynamicField.Value)); 195Assert.True(headers[i].Name.AsSpan().SequenceEqual(dynamicTable[i].Name)); 196Assert.True(headers[i].Value.AsSpan().SequenceEqual(dynamicTable[i].Value));
UrlDecoderTests.cs (22)
20int length = UrlDecoder.DecodeRequestLine(input.AsSpan(), destination.AsSpan()); 29int length = UrlDecoder.DecodeRequestLine(input.AsSpan(), destination.AsSpan(), false); 30Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan())); 39int length = UrlDecoder.DecodeInPlace(destination.AsSpan()); 48input.AsSpan().CopyTo(destination); 49int length = UrlDecoder.DecodeInPlace(destination.AsSpan(), false); 50Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan())); 57Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1))); 64Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1), false)); 71var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new char[source.Length + 10]); 79var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new byte[source.Length + 10], false); 87Assert.Throws<InvalidOperationException>(() => UrlDecoder.DecodeInPlace(source.AsSpan())); 94Assert.Throws<InvalidOperationException>(() => UrlDecoder.DecodeInPlace(source.AsSpan(), false)); 106var length = UrlDecoder.DecodeInPlace(source.AsSpan()); 120var length = UrlDecoder.DecodeInPlace(source.AsSpan(), false); 122Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes(input).AsSpan())); 130var length = UrlDecoder.DecodeInPlace(source.AsSpan(), true); 132Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes("/").AsSpan())); 144var length = UrlDecoder.DecodeInPlace(source.AsSpan()); 158var length = UrlDecoder.DecodeInPlace(source.AsSpan(), true); 160Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes(input).AsSpan()));
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Protocol\MemoryBufferWriterTests.cs (2)
366bufferWriter.Write(new byte[] { 2, 3, 4 }.AsSpan()); 385bufferWriter.Write(new byte[] { 2, 3, 4 }.AsSpan());
Microsoft.AspNetCore.SignalR.Core (1)
Internal\Utf8HashLookup.cs (1)
64if (_slots[i].caseSensitiveHashCode == caseSensitiveHashCode && encodedValue.SequenceEqual(_slots[i].encodedValue.AsSpan()))
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
Microsoft.Build (1)
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (1)
298skipProjects.AsSpan().Fill(true);
Microsoft.Build.Tasks.Core (5)
AssemblyDependency\ReferenceTable.cs (2)
2315if (!rpkt.AsSpan().SequenceEqual(dpkt.AsSpan()))
AssemblyNameExtension.cs (2)
788return aPKT.AsSpan().SequenceEqual(bPKT.AsSpan());
MSBuild.cs (1)
264skipProjects.AsSpan().Fill(true);
Microsoft.CodeAnalysis (7)
Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
CommandLine\CommandLineParser.cs (1)
630lineBuffer.CopyTo(temp.AsSpan());
Compilation\DeterministicKeyBuilder.cs (1)
355WriteByteArrayValue(writer, "publicKey", peReader.GetBlobBytes(assemblyDef.PublicKey).AsSpan());
Syntax\SyntaxTriviaListBuilder.cs (3)
84=> Add(items.AsSpan()); 92=> Add(items.AsSpan(), offset, length); 101items.Slice(offset, length).CopyTo(_nodes.AsSpan().Slice(_count, length));
Microsoft.CodeAnalysis.CodeStyle (3)
src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
373span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\NullablePublicAPITests.cs (2)
3258var indexers = root.DescendantNodes().OfType<ElementAccessExpressionSyntax>().ToArray().AsSpan(); 3310var elementAccesses = root.DescendantNodes().OfType<ElementAccessExpressionSyntax>().ToArray().AsSpan();
Microsoft.CodeAnalysis.Test.Utilities (1)
Metadata\ILValidation.cs (1)
98var snKey = CryptoBlobParser.ToRSAParameters(publicKeyParams.AsSpan(), includePrivateParameters: false);
Microsoft.CodeAnalysis.Workspaces (7)
src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
373span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
335ThrowIfNotOk(NativeMethods.sqlite3_blob_read(blob, bytes.AsSpan(), offset: 0));
Workspace\Solution\Checksum.cs (1)
43=> From(checksum.AsSpan());
Workspace\Solution\Checksum_Factory.cs (2)
141var hashes = ImmutableCollectionsMarshal.AsArray(checksums).AsSpan(); 148var source = ImmutableCollectionsMarshal.AsArray(bytes).AsSpan();
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
ObjectSerializationTests.cs (1)
263writer.WriteSpan(data.AsSpan());
Microsoft.DotNet.Build.Tasks.Installers (7)
src\ArReader.cs (2)
26if (!magic.AsSpan().SequenceEqual("!<arch>\n"u8)) 67if (!footer.AsSpan().SequenceEqual("`\n"u8))
src\CpioReader.cs (1)
28if (!magic.AsSpan().SequenceEqual("070701"u8))
src\RpmHeader.cs (4)
135IndexEntry indexEntry = ReadIndexEntry(store.AsSpan().Slice(entry.Offset)); 210contents.SetValue(BinaryPrimitives.ReadInt16BigEndian(store.AsSpan().Slice(offset.AlignUp(2), 2)), i); 215contents.SetValue(BinaryPrimitives.ReadInt32BigEndian(store.AsSpan().Slice(offset.AlignUp(4), 4)), i); 220contents.SetValue(BinaryPrimitives.ReadInt64BigEndian(store.AsSpan().Slice(offset.AlignUp(8), 8)), i);
Microsoft.DotNet.XUnitAssert.Tests (49)
Sdk\CollectionTrackerTests.cs (9)
80 var span = new[] { 42, 2112 }.AsSpan(); 92 var span = new[] { 42, 2112 }.AsSpan(); 104 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan(); 116 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan(); 128 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan(); 231 var span = new object[0].AsSpan(); 239 var span = new object[0].AsSpan(); 251 var span = new object[] { 1, 2.3M, "Hello, world!" }.AsSpan(); 263 var span = new object[] { 1, 2.3M, "Hello, world!", 42, 2112, new object() }.AsSpan();
SpanAssertsTests.cs (40)
120 Assert.Contains(new int[] { 3, 4 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan()); 126 Assert.Contains(new string[] { "test", "it" }.AsSpan(), new string[] { "something", "interesting", "test", "it", "out" }.AsSpan()); 144 var ex = Record.Exception(() => Assert.Contains(new int[] { 13, 14 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan())); 343 Assert.DoesNotContain(new int[] { 13, 14 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan()); 349 Assert.DoesNotContain(new string[] { "it", "test" }.AsSpan(), new string[] { "something", "interesting", "test", "it", "out" }.AsSpan()); 367 var ex = Record.Exception(() => Assert.DoesNotContain(new int[] { 3, 4 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan())); 715 Assert.Equal(value1.AsSpan(), value2.AsSpan()); 716 Assert.Equal(value2.AsSpan(), value1.AsSpan()); 719 Assert.Equal(value1.AsSpan(), value2.Spanify()); 720 Assert.Equal(value2.AsSpan(), value1.Spanify()); 723 Assert.Equal(value1.Spanify(), value2.AsSpan()); 724 Assert.Equal(value2.Spanify(), value1.AsSpan()); 749 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.AsSpan(), new int[] { 1, 2, 3 }.AsSpan())); 750 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.AsSpan(), new int[] { 1, 2, 3 }.Spanify())); 751 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.Spanify(), new int[] { 1, 2, 3 }.AsSpan())); 772 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.AsSpan(), new int[] { 1, 2, 3, 4 }.AsSpan())); 773 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.AsSpan(), new int[] { 1, 2, 3, 4 }.Spanify())); 774 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.Spanify(), new int[] { 1, 2, 3, 4 }.AsSpan())); 795 Assert.Equal(value1.AsSpan(), value2.AsSpan()); 796 Assert.Equal(value2.AsSpan(), value1.AsSpan()); 799 Assert.Equal(value1.AsSpan(), value2.Spanify()); 800 Assert.Equal(value2.AsSpan(), value1.Spanify()); 803 Assert.Equal(value1.Spanify(), value2.AsSpan()); 804 Assert.Equal(value2.Spanify(), value1.AsSpan()); 828 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.AsSpan(), new string[] { "yes", "no", "maybe", "so" }.AsSpan())); 829 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.AsSpan(), new string[] { "yes", "no", "maybe", "so" }.Spanify())); 830 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.Spanify(), new string[] { "yes", "no", "maybe", "so" }.AsSpan()));
Microsoft.Extensions.AI.Abstractions (1)
Contents\DataContent.cs (1)
158bool wrote = array.AsSpan().TryWrite($"data:{MediaType};base64,", out int prefixLength);
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceEmbeddingGenerator.cs (3)
137OperationStatus status = Base64.DecodeFromUtf8(base64, bytes.AsSpan(), out int bytesConsumed, out int bytesWritten); 145bytes.AsSpan(0, bytesWritten).CopyTo(MemoryMarshal.AsBytes(vector.AsSpan())); 148Span<int> ints = MemoryMarshal.Cast<float, int>(vector.AsSpan());
Microsoft.Extensions.Caching.Hybrid.Tests (3)
TagSetTests.cs (3)
52arr.AsSpan().Clear(); // to check defensive copy 83arr.AsSpan().Clear(); // to check defensive copy 120arr.AsSpan().Clear(); // to check defensive copy
Microsoft.Extensions.Compliance.Abstractions (3)
Redaction\Redactor.cs (3)
150return Redact(((char[])(object)value).AsSpan()); 201return Redact(((char[])(object)value).AsSpan(), destination); 265ros = ((char[])(object)value).AsSpan();
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Redaction\NullRedactorTest.cs (1)
44Assert.Throws<ArgumentException>(() => r.Redact("ABCD".AsSpan(), new char[1].AsSpan()));
Microsoft.Extensions.DependencyInjection.Abstractions (3)
ActivatorUtilities.cs (3)
970return invoker.Invoke(arguments.AsSpan()); 1132return invoker.Invoke(constructorArguments.AsSpan()); 1145return invoker.Invoke(arguments.AsSpan());
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
ByteArrayEqualityComparer.cs (1)
18return x.AsSpan().SequenceEqual(y);
Microsoft.Extensions.FileProviders.Physical (2)
PollingWildCardChangeToken.cs (2)
166return previousHash.AsSpan().SequenceEqual(currentHash.AsSpan());
Microsoft.Extensions.Hosting.Systemd (1)
SystemdHelpers.cs (1)
58return comm.AsSpan().SequenceEqual("systemd\n"u8);
Microsoft.Extensions.Telemetry (2)
Logging\JustInTimeRedactor.cs (2)
120inputAsSpan = c.AsSpan(); 159result = t.AsSpan().Slice(0, redactedLen).ToString();
Microsoft.ML.Core (9)
Utilities\ArrayUtils.cs (1)
40return FindIndexSorted(input.AsSpan(), min, lim, value);
Utilities\Stream.cs (7)
485ReadBinaryDataIntoSpan(reader, values.AsSpan()); 527ReadBinaryDataIntoSpan(reader, values.AsSpan()); 550ReadBinaryDataIntoSpan(reader, values.AsSpan()); 573ReadBinaryDataIntoSpan(reader, values.AsSpan()); 596ReadBinaryDataIntoSpan(reader, values.AsSpan()); 621ReadBinaryDataIntoSpan(reader, values.AsSpan()); 644ReadBinaryDataIntoSpan(reader, values.AsSpan());
Utilities\Utils.cs (1)
265return FindIndexSorted(input.AsSpan(), min, lim, value);
Microsoft.ML.DataView (1)
src\Microsoft.ML.Core\Utilities\ArrayUtils.cs (1)
40return FindIndexSorted(input.AsSpan(), min, lim, value);
Microsoft.ML.FastTree (16)
Utils\ToByteArrayExtensions.cs (16)
293MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 304buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 326MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 337buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 359MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 375buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 397MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 408buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 430MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 441buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 463MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 474buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 496MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 507buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 529MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 540buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan()));
Microsoft.ML.ImageAnalytics (1)
ImageLoader.cs (1)
338var readBufferSpan = readBuffer.AsSpan();
Microsoft.ML.StandardTrainers (3)
LdSvm\LdSvmModelParameters.cs (3)
194ctx.Writer.WriteSinglesNoCount(_biasW.AsSpan()); 196ctx.Writer.WriteSinglesNoCount(_biasTheta.AsSpan()); 198ctx.Writer.WriteSinglesNoCount(_biasThetaPrime.AsSpan());
Microsoft.ML.Tokenizers (26)
Model\CodeGenTokenizer.cs (1)
1298bytesIndex += Helpers.GetUtf8Bytes(removePrefixSpace ? specialToken.AsSpan().Slice(1) : specialToken.AsSpan(), bytes.AsSpan().Slice(bytesIndex));
Model\EnglishRobertaTokenizer.cs (3)
393List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 699List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 744List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping);
Model\SentencePieceUnigramModel.cs (15)
150normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 167normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 181Span<char> utf16NormalizedString = normalizedString.AsSpan().Slice(normalizedStringIndex); 186utf16NormalizedString = normalizedString.AsSpan().Slice(normalizedStringIndex); 195Span<char> normalizedUtf16Span = normalizedString.AsSpan().Slice(normalizedStringIndex); 199normalizedUtf16Span = normalizedString.AsSpan().Slice(normalizedStringIndex); 256normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 284normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 295Span<byte> byteSpan = MemoryMarshal.AsBytes(buffer.AsSpan()); 700normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 722normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1070normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1092normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1326normalizedText = normalizedString is not null ? normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null; 1344normalizedText = normalizedString is not null ? normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null;
Model\TiktokenTokenizer.cs (1)
842utf8Bytes.CopyTo(tmp.AsSpan());
Normalizer\SentencePieceNormalizer.cs (2)
409_spaceSymbol.AsSpan().CopyTo(normalized.Slice(normalizedIndex)); 471_spaceSymbol.AsSpan().CopyTo(normalized.Slice(normalizedIndex));
PreTokenizer\RegexPreTokenizer.cs (3)
118if (!TryGetMatch(specialTokensRegex, text.AsSpan(), beginning, textLength - beginning, out specialMatch)) 123while (TryGetMatch(regex, text.AsSpan(), beginning, specialMatch.Offset - beginning, out match)) 134while (TryGetMatch(regex, text.AsSpan(), beginning, textLength - beginning, out match))
Utils\Helpers.cs (1)
25arrayPoolArray.CopyTo(tmp.AsSpan());
Microsoft.ML.Tokenizers.Tests (36)
BpeTests.cs (5)
328status = bpe.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens, out idsConsumed, out charactersWritten); 338status = bpe.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens, out idsConsumed, out charactersWritten); 342Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString()); 836Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out int idsConsumed, out int charsWritten)); 839Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: false, out idsConsumed, out charsWritten));
CodeGenTests.cs (3)
314status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten); 324status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten); 328Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
EnglishRobertaTests.cs (3)
319status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 327status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten); 331Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
LlamaTests.cs (18)
310status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 320status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten); 324Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString()); 848Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 850Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 853Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten)); 856Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().ToString()); 862Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 864Assert.True(textWithSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 867Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 870Assert.Equal(textWithSpecialTokens, destinationBuffer.AsSpan().ToString()); 887Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 889Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 892Assert.Equal(OperationStatus.Done, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten)); 895Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().Slice(0, charactersWritten).ToString()); 901Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 903var sp = destinationBuffer.AsSpan().Slice(0, charactersWritten); 911Assert.Equal(OperationStatus.Done, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out idsConsumed, out charactersWritten));
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (1)
25arrayPoolArray.CopyTo(tmp.AsSpan());
TiktokenTests.cs (3)
173status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 183status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten); 187Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
UnigramTests.cs (3)
545Assert.Equal(decodedString, buffer.AsSpan().Slice(0, charsWritten).ToString()); 549status = tokenizer.Decode(ids, buffer.AsSpan().Slice(0, i), considerSpecialTokens: false, out idsConsumed, out charsWritten); 551Assert.Equal(decodedString.AsSpan().Slice(0, charsWritten).ToString(), buffer.AsSpan().Slice(0, charsWritten).ToString());
Microsoft.ML.TorchSharp (2)
AutoFormerV2\Anchors.cs (1)
62var imageShape = torch.tensor(image.shape.AsSpan().Slice(2).ToArray());
Roberta\Models\RobertaModel.cs (1)
112var questionSize = srcTokenArray.AsSpan().IndexOf(EosIndex) - 1;
MSBuild (2)
AssemblyNameExtension.cs (2)
788return aPKT.AsSpan().SequenceEqual(bPKT.AsSpan());
PresentationCore.Tests (1)
System\Windows\Media\Imaging\WriteableBitmap.Tests.cs (1)
54MemoryMarshal.Cast<byte, uint>(smallRect.AsSpan()).Fill(0xFF00E6FF);
System.Data.Common (2)
System\Data\DataKey.cs (1)
173return column1.AsSpan().SequenceEqual(column2);
System\Data\RelatedView.cs (1)
66bool allow = childValues.AsSpan().SequenceEqual(parentValues);
System.Data.Odbc (3)
System\Data\Odbc\OdbcHandle.cs (3)
191sqlState = new string(buffer.AsSpan(0, buffer.AsSpan().IndexOf('\0'))); 211sqlState = new string(buffer.AsSpan(0, buffer.AsSpan().IndexOf('\0'))); 217messageBuilder.Append(new string(message.AsSpan(0, message.AsSpan().IndexOf('\0'))));
System.Diagnostics.DiagnosticSource (12)
System\Diagnostics\Metrics\Counter.cs (1)
69public void Add(T delta, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(delta, tags.AsSpan());
System\Diagnostics\Metrics\CounterAggregator.cs (1)
62foreach (ref PaddedDouble paddedDelta in _deltas.AsSpan())
System\Diagnostics\Metrics\Gauge.cs (1)
67public void Record(T value, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(value, tags.AsSpan());
System\Diagnostics\Metrics\Histogram.cs (1)
71public void Record(T value, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(value, tags.AsSpan());
System\Diagnostics\Metrics\Instrument.common.cs (1)
87protected void RecordMeasurement(T measurement) => RecordMeasurement(measurement, Instrument.EmptyTags.AsSpan());
System\Diagnostics\Metrics\Measurement.cs (2)
82tags.CopyTo(_tags.AsSpan()); 95public ReadOnlySpan<KeyValuePair<string, object?>> Tags => _tags.AsSpan();
System\Diagnostics\Metrics\ObjectSequence.netcore.cs (1)
47return _values.AsSpan();
System\Diagnostics\Metrics\StringSequence.cs (3)
88_values.AsSpan(); 91_values.AsSpan().SequenceEqual(other._values.AsSpan());
System\Diagnostics\Metrics\UpDownCounter.cs (1)
68public void Add(T delta, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(delta, tags.AsSpan());
System.Formats.Cbor (3)
System\Formats\Cbor\Writer\CborWriter.Map.cs (1)
159Span<byte> source = _buffer.AsSpan();
System\Formats\Cbor\Writer\CborWriter.String.cs (2)
29WriteByteString(value.AsSpan()); 206Span<byte> buffer = _buffer.AsSpan();
System.Formats.Nrbf (6)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (5)
131Span<T> valuesToRead = result.AsSpan(); 164Span<short> span = MemoryMarshal.Cast<T, short>(result.AsSpan()); 176Span<int> span = MemoryMarshal.Cast<T, int>(result.AsSpan()); 188Span<long> span = MemoryMarshal.Cast<T, long>(result.AsSpan()); 204Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(result.AsSpan());
System\Formats\Nrbf\RectangularArrayRecord.cs (1)
39public override ReadOnlySpan<int> Lengths => _lengths.AsSpan();
System.IO.Compression (1)
System\IO\Compression\ZipArchive.cs (1)
557Span<byte> fileBufferSpan = fileBuffer.AsSpan();
System.Net.HttpListener (1)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
17DumpBuffer(thisOrContextObject, buffer.AsSpan(), memberName);
System.Net.NetworkInformation (2)
System\Net\NetworkInformation\PhysicalAddress.cs (2)
64_address.AsSpan().SequenceEqual(other._address); 68return Convert.ToHexString(_address.AsSpan());
System.Net.Security (7)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
17DumpBuffer(thisOrContextObject, buffer.AsSpan(), memberName);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (2)
376!mechListMIC.AsSpan().SequenceEqual(blob.AsSpan()))
System\Net\Security\SslApplicationProtocol.cs (1)
38protocol.AsSpan().ToArray() :
System\Net\Security\SslSessionsCache.cs (1)
89thumbPrint.AsSpan().SequenceEqual(otherThumbPrint);
System\Net\Security\SslStream.Protocol.cs (1)
1389oldPayload.AsSpan<byte>().CopyTo(Payload);
System\Net\Security\SslStreamCertificateContext.Linux.cs (1)
352issuerHandles.AsSpan().Clear();
System.Net.Sockets (3)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
17DumpBuffer(thisOrContextObject, buffer.AsSpan(), memberName);
System\Net\Sockets\Socket.cs (2)
1298SendFile(fileName, preBuffer.AsSpan(), postBuffer.AsSpan(), flags);
System.Net.WebClient (2)
System\Net\WebClient.cs (2)
1141if (data.AsSpan().StartsWith(preamble)) 1157bomLengthInData = data.AsSpan().StartsWith(preamble) ? preamble.Length : 0;
System.Private.CoreLib (11)
src\libraries\System.Private.CoreLib\src\System\ApplicationId.cs (1)
77_publicKeyToken.AsSpan().SequenceEqual(other._publicKeyToken);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (2)
542return (!monthNames.AsSpan().SequenceEqual(genitiveMonthNames) || !abbrevMonthNames.AsSpan().SequenceEqual(genitiveAbbrevMonthNames))
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
413result.AsSpan().Replace((byte)' ', (byte)'+');
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
333GetItems(choices, items.AsSpan());
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\ISimdVector_2.cs (2)
184static virtual void CopyTo(TSelf vector, T[] destination) => TSelf.CopyTo(vector, destination.AsSpan()); 235static virtual TSelf Create(T[] values) => TSelf.Create(values.AsSpan());
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (1)
46_hashEntries.AsSpan().Fill(values[0]);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
87existingBucket.AsSpan().CopyTo(newBucket);
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (1)
407KeyValuePair<IAsyncLocal, object?>[] newValues = _keyValues.AsSpan().ToArray();
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (1)
964return currentRules.AsSpan().SequenceEqual(otherRules);
System.Private.Windows.Core (2)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
157if (isSerializedObject = bytes.AsSpan().StartsWith(s_serializedObjectID))
System\TypeExtensions.cs (1)
181|| ComparePublicKeys(assemblyName.GetPublicKeyToken().AsSpan(), assemblyNameInfo.PublicKeyOrToken.AsSpan()));
System.Private.Xml (1)
System\Xml\Schema\DataTypeImplementation.cs (1)
876value1.AsSpan().SequenceEqual(value2) ? 0 : -1;
System.Reflection.Metadata (5)
System\Reflection\Metadata\BlobBuilder.cs (2)
774WriteBytes(buffer.AsSpan()); 971WriteUTF16(value.AsSpan());
System\Reflection\Metadata\BlobContentId.cs (1)
81return FromHash(hashCode.AsSpan());
System\Reflection\Metadata\BlobWriter.cs (2)
220WriteBytes(buffer.AsSpan()); 379WriteUTF16(value.AsSpan());
System.Resources.Extensions (1)
System\Resources\Extensions\TypeNameComparer.cs (1)
117return pkt1.AsSpan().SequenceEqual(pkt2);
System.Runtime.Numerics (4)
System\Number.BigInteger.cs (1)
258if (bits.AsSpan().ContainsAnyExcept(0u))
System\Numerics\BigInteger.cs (3)
387value.Slice(0, wholeUInt32Count * 4).CopyTo(MemoryMarshal.AsBytes<uint>(val.AsSpan())); 1092hash.AddBytes(MemoryMarshal.AsBytes(_bits.AsSpan())); 1145return _sign == other._sign && _bits.AsSpan().SequenceEqual(other._bits);
System.Security.Cryptography (32)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (2)
437lastBlock.AsSpan().CopyTo(destination.AsSpan(written)); 957Span<byte> tmpEndSpan = tmpEnd.AsSpan();
src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (1)
180SignData(new ReadOnlySpan<byte>(data), destination.AsSpan(), new ReadOnlySpan<byte>(context));
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (1)
761array.AsSpan().CopyTo(next);
System\Security\Cryptography\CngProperty.cs (1)
80return _value.AsSpan().SequenceEqual(other._value);
System\Security\Cryptography\Helpers.cs (1)
157return a1.AsSpan().SequenceEqual(a2);
System\Security\Cryptography\HMACMD5.cs (1)
108int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HMACSHA1.cs (1)
112int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HMACSHA256.cs (1)
104int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HMACSHA3_256.cs (1)
140int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HMACSHA3_384.cs (1)
140int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HMACSHA3_512.cs (1)
140int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HMACSHA384.cs (1)
121int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HMACSHA512.cs (1)
118int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\MD5.cs (1)
70int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
151value.AsSpan().CopyTo(_salt);
System\Security\Cryptography\SHA1.cs (1)
67int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\SHA256.cs (1)
66int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\SHA3_256.cs (1)
92int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\SHA3_384.cs (1)
92int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\SHA3_512.cs (1)
92int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\SHA384.cs (1)
66int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\SHA512.cs (1)
66int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\UniversalCryptoDecryptor.cs (1)
98_heldoverCipher.AsSpan().CopyTo(ciphertext);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (2)
1386_errors.AsSpan().Clear(); 1392toReturn.AsSpan().CopyTo(_errors);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (3)
871if (!pk1.AsSpan().SequenceEqual(pk2)) 975if (w1 != w2 || !pk1.AsSpan().SequenceEqual(pk2)) 1067if (!pk1.AsSpan().SequenceEqual(pk2))
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
209Import(rawData.AsSpan()); 232Import(rawData.AsSpan(), password.AsSpan(), keyStorageFlags);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (1)
271_rentedSpki.AsSpan().Clear();
System.Security.Cryptography.Cose (6)
System\Security\Cryptography\Cose\CoseHeaderValue.cs (2)
53return FromEncodedValue(encodedValue.AsSpan()); 118return FromBytes(value.AsSpan());
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (2)
642=> AddSignatureForEmbedded(signer, associatedData.AsSpan()); 693AddSignatureForDetached(detachedContent.AsSpan(), signer, associatedData);
System\Security\Cryptography\Cose\CoseSign1Message.cs (2)
56return SignCore(detachedContent.AsSpan(), null, signer, associatedData, isDetached: true); 81return SignCore(embeddedContent.AsSpan(), null, signer, associatedData, isDetached: false);
System.Security.Cryptography.Pkcs (9)
Internal\Cryptography\PkcsHelpers.cs (2)
216ba1.AsSpan().SequenceEqual(ba2.AsSpan());
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (2)
437lastBlock.AsSpan().CopyTo(destination.AsSpan(written)); 957Span<byte> tmpEndSpan = tmpEnd.AsSpan();
System\Security\Cryptography\Pkcs\CmsSigner.cs (1)
401cert.SubjectName.RawData.AsSpan().SequenceEqual(cert.IssuerName.RawData))
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (1)
159_encodedBytes.AsSpan().CopyTo(destination);
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (1)
221_encodedBytes.AsSpan().CopyTo(destination);
System\Security\Cryptography\Pkcs\SignerInfo.cs (1)
647if (!contentDigest.AsSpan().SequenceEqual(digestAttr.MessageDigest))
System\Security\Cryptography\Pkcs\SubjectIdentifier.cs (1)
73DummySignerEncodedValue.AsSpan().SequenceEqual(issuerNameSpan))
System.Security.Cryptography.Xml (3)
System\Security\Cryptography\Xml\SignedXml.cs (1)
1065return m_signature.SignatureValue.AsSpan().SequenceEqual(hashValue.AsSpan(0, m_signature.SignatureValue.Length));
System\Security\Cryptography\Xml\SymmetricKeyWrap.cs (2)
240if (!rgbA.AsSpan().SequenceEqual(s_rgbAES_KW_IV.AsSpan()))
System.Text.Json (4)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
162if (childMap.AsSpan().IndexOf(true) == -1)
System\Text\Json\Document\JsonDocument.MetadataDb.cs (1)
384Span<int> newDbInts = MemoryMarshal.Cast<byte, int>(newDatabase.AsSpan());
System\Text\Json\Document\JsonDocument.Parse.cs (1)
91utf8Json.CopyTo(utf8Bytes.AsSpan());
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
317(resolver?.CustomTypeDiscriminatorPropertyNameUtf8?.AsSpan().SequenceEqual(propertyName) == true);
System.Text.Json.SourceGeneration (1)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
162if (childMap.AsSpan().IndexOf(true) == -1)
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\Regex.cs (1)
331result = capslist.AsSpan().ToArray();
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
832literal.Chars is not null ? slice.IndexOfAny(literal.Chars.AsSpan()) :
System.Text.RegularExpressions.Generator (1)
src\libraries\Common\src\System\HexConverter.cs (1)
186new char[bytes.Length * 2].AsSpan() :
System.Windows.Forms (1)
System\Windows\Forms\Controls\ImageList\ImageListStreamer.cs (1)
97ReadOnlySpan<byte> buffer = stream.GetBuffer().AsSpan()[..(int)stream.Length];
System.Windows.Forms.Design (3)
System\ComponentModel\Design\BinaryEditor.cs (1)
62Encoding.Unicode.GetBytes(stringValue.AsSpan(), buffer.AsSpan());
System\ComponentModel\Design\ByteViewer.cs (2)
425Encoding.Unicode.GetChars(dataBuf.AsSpan(), text); 593currentFile.Write(_dataBuf.AsSpan());
System.Windows.Forms.Primitives.TestUtilities (4)
Extensions\AssertExtensions.cs (4)
400if (!expected.AsSpan().SequenceEqual(actual.AsSpan())) 527public static void SequenceEqual<T>(T[] expected, T[] actual) where T : IEquatable<T> => SequenceEqual(expected.AsSpan(), actual.AsSpan());
Templates.Blazor.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Mvc.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Templates.Tests (1)
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
339RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Test.Utilities (1)
CodeMetricsTestsBase.cs (1)
140parameters.AsSpan().Fill(Type.Missing);
xunit.assert (3)
EqualityAsserts.cs (2)
68 if (expected == null || actual == null || !expected.AsSpan().SequenceEqual(actual)) 591 if (expected.AsSpan().SequenceEqual(actual))
SpanAsserts.cs (1)
200 Equal(expectedSpan, actualArray.AsSpan());