Skip to content

Commit a8b7c24

Browse files
committed
fix smell: 'UdpClientWrapper' - method 'GetHashCode', prefer static 'MD5.HashData' method over 'ComputeHash'
1 parent 148939a commit a8b7c24

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

NetSdrClientApp/Networking/UdpClientWrapper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ public override int GetHashCode()
8181
{
8282
var payload = $"{nameof(UdpClientWrapper)}|{_localEndPoint.Address}|{_localEndPoint.Port}";
8383

84-
using var md5 = MD5.Create();
85-
var hash = md5.ComputeHash(Encoding.UTF8.GetBytes(payload));
84+
var hash = MD5.HashData(Encoding.UTF8.GetBytes(payload));
8685

8786
return BitConverter.ToInt32(hash, 0);
8887
}

0 commit comments

Comments
 (0)