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