95 references to Sha256Hasher
dotnet (14)
CommandFactory\CommandResolution\CompositeCommandResolver.cs (1)
43{ "commandName", commandResolverArguments is null ? string.Empty : Sha256Hasher.HashWithNormalizedCasing(commandResolverArguments.CommandName) },
Commands\Hidden\InternalReportInstallSuccess\InternalReportInstallSuccessCommand.cs (1)
36var filter = new TelemetryFilter(Sha256Hasher.HashWithNormalizedCasing);
Commands\MSBuild\MSBuildLogger.cs (1)
260properties[propertyToBeHashed] = Sha256Hasher.HashWithNormalizedCasing(value!);
Commands\New\MSBuildEvaluation\MSBuildEvaluator.cs (3)
191targetFrameworksString = string.Join(",", targetFrameworks.Select(tfm => Sha256Hasher.HashWithNormalizedCasing(tfm))); 195targetFrameworksString = Sha256Hasher.HashWithNormalizedCasing(targetFramework); 200{ "ProjectPath", Sha256Hasher.HashWithNormalizedCasing(projectPath)},
Commands\Run\RunCommand.cs (2)
812var projectIdentifier = RunTelemetry.GetFileBasedIdentifier(EntryPointFileFullPath, Sha256Hasher.Hash); 840var projectIdentifier = RunTelemetry.GetProjectBasedIdentifier(ProjectFileFullPath, GetRepositoryRoot(), Sha256Hasher.Hash);
Commands\Run\RunTelemetry.cs (2)
113return Sha256Hasher.Hash(pathToHash.ToLowerInvariant()); 133return Sha256Hasher.Hash(entryPointFilePath.ToLowerInvariant());
Commands\Run\VirtualProjectBuildingCommand.cs (1)
1093string hash = Sha256Hasher.HashWithNormalizedCasing(entryPointFileFullPath);
Installer\Windows\WindowsUtils.cs (1)
31return Uuid.Create($"{processId};{Environment.ProcessPath.ToLowerInvariant()};{Sha256Hasher.Hash(MacAddressGetter.GetMacAddress())};{string.Join(";", values)}")
Program.cs (1)
157TelemetryEventEntry.TelemetryFilter = new TelemetryFilter(Sha256Hasher.HashWithNormalizedCasing);
Telemetry\TelemetryCommonProperties.cs (1)
28private readonly Func<string, string> _hasher = hasher ?? Sha256Hasher.Hash;
dotnet.Tests (69)
TelemetryCommandTest.cs (43)
25TelemetryEventEntry.TelemetryFilter = new TelemetryFilter(Sha256Hasher.HashWithNormalizedCasing); 52e.Properties["verb"] == Sha256Hasher.Hash("HELP")); 63e.Properties["verb"] == Sha256Hasher.Hash("HELP") && 78e.Properties["verb"] == Sha256Hasher.Hash("HELP") && 92e.Properties["verb"] == Sha256Hasher.Hash("HELP") && 108e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 110e.Properties["verb"] == Sha256Hasher.Hash("NEW")); 123e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 125e.Properties["verb"] == Sha256Hasher.Hash("NEW") && 142e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 144e.Properties["verb"] == Sha256Hasher.Hash("HELP")); 157e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 159e.Properties["verb"] == Sha256Hasher.Hash("ADD")); 172e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 174e.Properties["verb"] == Sha256Hasher.Hash("ADD")); 187e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 189e.Properties["verb"] == Sha256Hasher.Hash("REMOVE")); 201e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 203e.Properties["verb"] == Sha256Hasher.Hash("LIST")); 216e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 218e.Properties["verb"] == Sha256Hasher.Hash("SOLUTION")); 233e.Properties["argument"] == Sha256Hasher.Hash(argumentToSend.ToUpper()) && 235e.Properties["verb"] == Sha256Hasher.Hash("NUGET")); 248e.Properties[optionKey] == Sha256Hasher.Hash(optionValueToSend.ToUpper()) && 250e.Properties["verb"] == Sha256Hasher.Hash("NEW")); 264e.Properties[optionKey] == Sha256Hasher.Hash(optionValueToSend.ToUpper()) && 266e.Properties["verb"] == Sha256Hasher.Hash("RESTORE")); 280e.Properties[optionKey] == Sha256Hasher.Hash(optionValueToSend.ToUpper()) && 282e.Properties["verb"] == Sha256Hasher.Hash("RESTORE") && 300e.Properties[optionKey] == Sha256Hasher.Hash(optionValueToSend.ToUpper()) && 302e.Properties["verb"] == Sha256Hasher.Hash("BUILD")); 316e.Properties[optionKey] == Sha256Hasher.Hash(optionValueToSend.ToUpper()) && 318e.Properties["verb"] == Sha256Hasher.Hash("PUBLISH")); 329e.Properties["configuration"] == Sha256Hasher.Hash("DEBUG") && 331e.Properties["verb"] == Sha256Hasher.Hash("BUILD")); 336e.Properties["runtime"] == Sha256Hasher.Hash($"{ToolsetInfo.LatestMacRuntimeIdentifier.ToUpper()}-X64") && 338e.Properties["verb"] == Sha256Hasher.Hash("BUILD")); 349e.Properties["configuration"] == Sha256Hasher.Hash("DEBUG") && 351e.Properties["verb"] == Sha256Hasher.Hash("CLEAN")); 356e.Properties["framework"] == Sha256Hasher.Hash(ToolsetInfo.CurrentTargetFramework.ToUpper()) && 358e.Properties["verb"] == Sha256Hasher.Hash("CLEAN")); 372e.Properties["verb"] == Sha256Hasher.Hash("PACKAGE UPDATE")); 386e.Properties["exeName"] == Sha256Hasher.Hash("DOTNET-SDK-LATEST-WIN-X64.EXE"));
TelemetryFilterTest.cs (26)
27TelemetryEventEntry.TelemetryFilter = new TelemetryFilter(Sha256Hasher.HashWithNormalizedCasing); 37e.Properties["verb"] == Sha256Hasher.Hash("BUILD") && 48e.Properties["verb"] == Sha256Hasher.Hash("BUILD") && 61e.Properties["verb"] == Sha256Hasher.Hash("BUILD") && 64e.Properties["globalJson"] == Sha256Hasher.HashWithNormalizedCasing(globalJsonState)); 74e.Properties["verb"] == Sha256Hasher.Hash("BUILD") && 85e.Properties["verb"] == Sha256Hasher.Hash("BUILD") && 100e.Properties["argument"] == Sha256Hasher.Hash("CONSOLE") && 102e.Properties["verb"] == Sha256Hasher.Hash("NEW") && 113e.Properties["argument"] == Sha256Hasher.Hash("CONSOLE") && 115e.Properties["verb"] == Sha256Hasher.Hash("NEW") && 127e.Properties["argument"] == Sha256Hasher.Hash("CONSOLE") && 129e.Properties["verb"] == Sha256Hasher.Hash("NEW") && 140e.Properties["argument"] == Sha256Hasher.Hash("CONSOLE") && 142e.Properties["verb"] == Sha256Hasher.Hash("NEW") && 157e.Properties["verb"] == Sha256Hasher.Hash("WORKLOAD") && 159Sha256Hasher.Hash("INSTALL") && 161Sha256Hasher.Hash("MICROSOFT-IOS-SDK-FULL")); 173e.Properties["verb"] == Sha256Hasher.Hash("TOOL") && 175Sha256Hasher.Hash("INSTALL") && 177Sha256Hasher.Hash("DOTNET-FORMAT")); 189e.Properties["verb"] == Sha256Hasher.Hash("WORKLOAD") && 191Sha256Hasher.Hash("INSTALL") && 193Sha256Hasher.Hash("MICROSOFT-IOS-SDK-FULL")); 205e.Properties["verb"] == Sha256Hasher.Hash("WORKLOAD") && 207Sha256Hasher.Hash("INSTALL"));
Microsoft.NET.Build.Tests (1)
GivenThatWeWantToBuildANetCoreAppForTelemetry.cs (1)
33return $"{{\"EventName\":\"targetframeworkeval\",\"Properties\":{{\"TargetFrameworkVersion\":\"{targetFrameworkVersion}\",\"RuntimeIdentifier\":\"{runtimeIdentifier}\",\"SelfContained\":\"{selfContained}\",\"UseApphost\":\"{useApphost}\",\"OutputType\":\"{outputType}\",\"UseArtifactsOutput\":\"{useArtifactsOutput}\",\"ArtifactsPathLocationType\":\"{artifactsPathLocationType}\",\"TargetPlatformIdentifier\":\"{targetPlatformIdentifier}\",\"UseMonoRuntime\":\"{useMonoRuntime}\",\"PublishAot\":\"{publishAot}\",\"PublishTrimmed\":\"{publishTrimmed}\",\"PublishSelfContained\":\"{publishSelfContained}\",\"PublishReadyToRun\":\"{publishReadyToRun}\",\"PublishReadyToRunComposite\":\"{publishReadyToRunComposite}\",\"PublishProtocol\":\"{publishProtocol}\",\"Configuration\":\"{Sha256Hasher.HashWithNormalizedCasing(configuration)}\"}}";
Microsoft.TemplateEngine.Cli (5)
TelemetryHelper.cs (1)
41hashedValues.Add(Sha256Hasher.HashWithNormalizedCasing(choiceValue));
TemplateInvoker.cs (4)
50string? templateName = Sha256Hasher.HashWithNormalizedCasing(templateToRun.Identity); 51string? templateShortNames = templateToRun.ShortNameList.Any() ? Sha256Hasher.HashWithNormalizedCasing(string.Join(',', templateToRun.ShortNameList)) : null; 55string? packageName = string.IsNullOrEmpty(templatePackage?.Identifier) ? null : Sha256Hasher.HashWithNormalizedCasing(templatePackage.Identifier); 56string? packageVersion = string.IsNullOrEmpty(templatePackage?.Version) ? null : Sha256Hasher.HashWithNormalizedCasing(templatePackage.Version);
Microsoft.TemplateEngine.Cli.UnitTests (6)
TelemetryHelperTests.cs (6)
96Assert.Equal(Sha256Hasher.HashWithNormalizedCasing("foo"), telemetryEntry); 170Assert.Equal(Sha256Hasher.HashWithNormalizedCasing("FOO"), telemetryEntry); 222Assert.Equal(Sha256Hasher.HashWithNormalizedCasing("foo") + ";" + Sha256Hasher.HashWithNormalizedCasing("bar"), telemetryEntry); 248Assert.Equal(Sha256Hasher.HashWithNormalizedCasing("foo") + ";" + Sha256Hasher.HashWithNormalizedCasing("bar"), telemetryEntry);