Skip to content

Commit a9fc8f4

Browse files
committed
Code Quality: Use a plain placeholder instead of a path hash in sanitized logs
1 parent 8190f3c commit a9fc8f4

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/Files.Shared/Utils/Logger/LogPathHelper.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using System;
55
using System.IO;
6-
using System.Security.Cryptography;
7-
using System.Text;
86
using System.Text.RegularExpressions;
97

108
namespace Files.Shared
@@ -30,14 +28,7 @@ public static string GetPathIdentifier(string? path)
3028

3129
try
3230
{
33-
var hashBytes = MD5.HashData(Encoding.UTF8.GetBytes(path));
34-
35-
//4 bytes, still low collision
36-
var shortHash = Convert.ToHexStringLower(hashBytes, 0, 4);
37-
38-
var extension = Path.GetExtension(path);
39-
40-
return $"[hash:{shortHash}{extension}]";
31+
return $"[path{Path.GetExtension(path)}]";
4132
}
4233
catch
4334
{

0 commit comments

Comments
 (0)