146 references to Sha1
Microsoft.CodeAnalysis (19)
Microsoft.CodeAnalysis.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp (7)
Syntax\CSharpSyntaxTree.cs (4)
348checksumAlgorithm: SourceHashAlgorithm.Sha1,
402checksumAlgorithm: SourceHashAlgorithm.Sha1,
460return ParseText(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), options, path, diagnosticOptions, isGeneratedCode, cancellationToken);
928=> ParseText(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), options, path, diagnosticOptions, isGeneratedCode: null, cancellationToken);
Syntax\SyntaxFactory.cs (2)
1548=> CSharpSyntaxTree.Create((CSharpSyntaxNode)root, (CSharpParseOptions?)options ?? CSharpParseOptions.Default, path, encoding, SourceHashAlgorithm.Sha1);
1562return CSharpSyntaxTree.ParseText(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), (CSharpParseOptions?)options, path, diagnosticOptions: null, isGeneratedCode: null, cancellationToken);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.Features.UnitTests (10)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (9)
69var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path);
83.WithProjectChecksumAlgorithm(projectPId, SourceHashAlgorithm.Sha1);
114Assert.Equal(SourceHashAlgorithm.Sha1, solution.GetDocument(documentIdA).GetTextSynchronously(default).ChecksumAlgorithm);
115Assert.Equal(SourceHashAlgorithm.Sha1, solution.GetDocument(documentIdB).GetTextSynchronously(default).ChecksumAlgorithm);
116Assert.Equal(SourceHashAlgorithm.Sha1, solution.GetDocument(documentIdC).GetTextSynchronously(default).ChecksumAlgorithm);
117Assert.Equal(SourceHashAlgorithm.Sha1, solution.GetDocument(documentIdE).GetTextSynchronously(default).ChecksumAlgorithm);
622AddDocument("a.cs", SourceText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path);
920WithProjectChecksumAlgorithm(projectId, SourceHashAlgorithm.Sha1).
922AddDocument(documentId, "test.cs", SourceText.From(source1, encoding, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path);
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.UnitTests (36)
EmbeddedTextTests.cs (24)
81var text = EmbeddedText.FromBytes("pathToEmpty", new ArraySegment<byte>(new byte[0], 0, 0), SourceHashAlgorithm.Sha1);
83Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
84AssertEx.Equal(SourceText.CalculateChecksum(new byte[0], 0, 0, SourceHashAlgorithm.Sha1), text.Checksum);
91var text = EmbeddedText.FromStream("pathToEmpty", new MemoryStream(new byte[0]), SourceHashAlgorithm.Sha1);
92var checksum = SourceText.CalculateChecksum(new byte[0], 0, 0, SourceHashAlgorithm.Sha1);
95Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
103var source = SourceText.From("", new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), SourceHashAlgorithm.Sha1);
105var checksum = SourceText.CalculateChecksum(new byte[0], 0, 0, SourceHashAlgorithm.Sha1);
108Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
117var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1);
121Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
132var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1);
137Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
145var source = SourceText.From(SmallSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
149Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
200var expected = SourceText.From(SmallSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
203var actual = SourceText.From(new StringReader(SmallSource), SmallSource.Length, Encoding.UTF8, SourceHashAlgorithm.Sha1);
215var expected = SourceText.From(LargeSource, Encoding.UTF8, SourceHashAlgorithm.Sha1);
218var actual = SourceText.From(new StringReader(LargeSource), LargeSource.Length, Encoding.UTF8, SourceHashAlgorithm.Sha1);
236SourceText.From(new MemoryStream(bytes), Encoding.ASCII, SourceHashAlgorithm.Sha1, canBeEmbedded: true) :
237SourceText.From(bytes, bytes.Length, Encoding.ASCII, SourceHashAlgorithm.Sha1, canBeEmbedded: true);
241Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
242AssertEx.Equal(SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1), source.GetChecksum());
256Assert.Equal(SourceHashAlgorithm.Sha1, text.ChecksumAlgorithm);
Microsoft.CodeAnalysis.VisualBasic (5)
Syntax\SyntaxNodeFactories.vb (2)
37Return VisualBasicSyntaxTree.Create(DirectCast(root, VisualBasicSyntaxNode), If(DirectCast(options, VisualBasicParseOptions), VisualBasicParseOptions.Default), path, encoding, SourceHashAlgorithm.Sha1)
50Return ParseSyntaxTree(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), options, path, cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (5)
Microsoft.CodeAnalysis.Workspaces (7)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces.UnitTests (28)
SolutionTests\SolutionTests.cs (28)
305Assert.Equal(SourceHashAlgorithm.Sha1, tree.GetText().ChecksumAlgorithm);
350var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
451var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
539var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
622var text = SourceText.From("new text without pp directives", encoding: null, SourceHashAlgorithm.Sha1);
705var text = SourceText.From("#if true", encoding: null, SourceHashAlgorithm.Sha1);
781var text = SourceText.From("new text", encoding: null, SourceHashAlgorithm.Sha1);
868var text = SourceText.From(" ", encoding: null, SourceHashAlgorithm.Sha1);
1618var textLoaderA = new TestTextLoader("class A {}", SourceHashAlgorithm.Sha1);
1619var textC = SourceText.From("class C {}", encoding: null, checksumAlgorithm: SourceHashAlgorithm.Sha1);
1623.WithProjectChecksumAlgorithm(projectId, SourceHashAlgorithm.Sha1);
1630await Verify(solution.GetRequiredDocument(documentAId), SourceHashAlgorithm.Sha1);
1631await Verify(solution.GetRequiredDocument(documentBId), SourceHashAlgorithm.Sha1);
1632await Verify(solution.GetRequiredDocument(documentCId), SourceHashAlgorithm.Sha1);
1633await Verify(solution.GetRequiredDocument(fileDocumentId), SourceHashAlgorithm.Sha1, checksumSHA1);
1637await Verify(solution.GetRequiredDocument(documentAId), SourceHashAlgorithm.Sha1);
1638await Verify(solution.GetRequiredDocument(documentBId), SourceHashAlgorithm.Sha1);
1639await Verify(solution.GetRequiredDocument(documentCId), SourceHashAlgorithm.Sha1);
1643solution = solution.WithProjectChecksumAlgorithm(projectId, SourceHashAlgorithm.Sha1);
1644await Verify(solution.GetRequiredDocument(documentAId), SourceHashAlgorithm.Sha1);
1645await Verify(solution.GetRequiredDocument(documentBId), SourceHashAlgorithm.Sha1);
1646await Verify(solution.GetRequiredDocument(documentCId), SourceHashAlgorithm.Sha1);
1647await Verify(solution.GetRequiredDocument(fileDocumentId), SourceHashAlgorithm.Sha1, checksumSHA1);
2365var loader = new TestTextLoader(checksumAlgorithm: SourceHashAlgorithm.Sha1);
2373Assert.Equal(SourceHashAlgorithm.Sha1, document.GetTextSynchronously(default).ChecksumAlgorithm);
2483var root = CSharp.SyntaxFactory.ParseSyntaxTree(SourceText.From("class C {}", encoding: null, SourceHashAlgorithm.Sha1)).GetRoot();
2484Assert.Equal(SourceHashAlgorithm.Sha1, root.SyntaxTree.GetText().ChecksumAlgorithm);
2513Assert.Equal(SourceHashAlgorithm.Sha1, root.SyntaxTree.GetText().ChecksumAlgorithm);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Roslyn.VisualStudio.Next.UnitTests (6)
Services\ServiceHubServicesTests.cs (4)
496private static SourceText CreateText(string content, Encoding encoding = null, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1)
506return SourceText.From(stream, encoding, SourceHashAlgorithm.Sha1, throwIfBinaryDetected: true);
510return SourceText.From(bytes, bytes.Length, encoding, SourceHashAlgorithm.Sha1, throwIfBinaryDetected: true);
593ImmutableArray.Create(("SG.cs", CreateText("X", Encoding.UTF8, checksumAlgorithm: SourceHashAlgorithm.Sha1))),