Skip to content

Commit b8c69e1

Browse files
committed
Simplify salt generation
1 parent ff69730 commit b8c69e1

File tree

5 files changed

+5
-17
lines changed

5 files changed

+5
-17
lines changed

DotnetRuntimeBootstrapper.AppHost.Cli/DotnetRuntimeBootstrapper.AppHost.Cli.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<ItemGroup>
1818
<PackageReference Include="CSharpier.MsBuild" Version="1.2.1" PrivateAssets="all" />
19-
<PackageReference Include="PolyShim" Version="2.0.0" PrivateAssets="all" />
19+
<PackageReference Include="PolyShim" Version="2.2.0" PrivateAssets="all" />
2020
<PackageReference Include="QuickJson" Version="1.1.0" PrivateAssets="all" />
2121
</ItemGroup>
2222

DotnetRuntimeBootstrapper.AppHost.Core/DotnetRuntimeBootstrapper.AppHost.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<ItemGroup>
77
<PackageReference Include="CSharpier.MsBuild" Version="1.2.1" PrivateAssets="all" />
8-
<PackageReference Include="PolyShim" Version="2.0.0" PrivateAssets="all" />
8+
<PackageReference Include="PolyShim" Version="2.2.0" PrivateAssets="all" />
99
<PackageReference Include="QuickJson" Version="1.1.0" PrivateAssets="all" />
1010
</ItemGroup>
1111

DotnetRuntimeBootstrapper.AppHost.Core/Utils/Extensions/PathExtensions.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
2-
using System.Globalization;
32
using System.IO;
4-
using System.Text;
53

64
namespace DotnetRuntimeBootstrapper.AppHost.Core.Utils.Extensions;
75

@@ -11,19 +9,9 @@ internal static class PathExtensions
119
{
1210
public static string GenerateTempFilePath(string fileNameBase)
1311
{
14-
static string GenerateSalt()
15-
{
16-
var buffer = new StringBuilder(8);
17-
18-
for (var i = 0; i < 8; i++)
19-
buffer.Append(Random.Shared.Next(0, 10).ToString(CultureInfo.InvariantCulture));
20-
21-
return buffer.ToString();
22-
}
23-
2412
var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileNameBase);
2513
var fileExtension = Path.GetExtension(fileNameBase);
26-
var salt = GenerateSalt();
14+
var salt = Random.Shared.GetHexString(8, true);
2715

2816
return Path.Combine(
2917
Path.GetTempPath(),

DotnetRuntimeBootstrapper.AppHost.Gui/DotnetRuntimeBootstrapper.AppHost.Gui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<ItemGroup>
1919
<PackageReference Include="CSharpier.MsBuild" Version="1.2.1" PrivateAssets="all" />
20-
<PackageReference Include="PolyShim" Version="2.0.0" PrivateAssets="all" />
20+
<PackageReference Include="PolyShim" Version="2.2.0" PrivateAssets="all" />
2121
<PackageReference Include="QuickJson" Version="1.1.0" PrivateAssets="all" />
2222
</ItemGroup>
2323

DotnetRuntimeBootstrapper/DotnetRuntimeBootstrapper.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
PrivateAssets="all"
3737
GeneratePathProperty="true"
3838
/>
39-
<PackageReference Include="PolyShim" Version="2.0.0" PrivateAssets="all" />
39+
<PackageReference Include="PolyShim" Version="2.2.0" PrivateAssets="all" />
4040
<PackageReference
4141
Include="Ressy"
4242
Version="1.0.3"

0 commit comments

Comments
 (0)