Skip to content

Commit 433c064

Browse files
committed
Simplify imports used by AnalyticsUtils.cs
1 parent b836a91 commit 433c064

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

com.unity.ml-agents/Runtime/Analytics/AnalyticsUtils.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Text;
3+
using System.Security.Cryptography;
24
using UnityEngine;
35

46
namespace Unity.MLAgents.Analytics
@@ -13,7 +15,7 @@ internal static class AnalyticsUtils
1315
/// <returns>A byte array to be hex encoded.</returns>
1416
private static string ToHexString(byte[] array)
1517
{
16-
System.Text.StringBuilder hex = new System.Text.StringBuilder(array.Length * 2);
18+
StringBuilder hex = new StringBuilder(array.Length * 2);
1719
foreach (byte b in array)
1820
{
1921
hex.AppendFormat("{0:x2}", b);
@@ -31,8 +33,8 @@ private static string ToHexString(byte[] array)
3133
public static string Hash(string key, string value)
3234
{
3335
string hash;
34-
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
35-
using (System.Security.Cryptography.HMACSHA256 hmac = new System.Security.Cryptography.HMACSHA256(encoder.GetBytes(key)))
36+
UTF8Encoding encoder = new UTF8Encoding();
37+
using (HMACSHA256 hmac = new HMACSHA256(encoder.GetBytes(key)))
3638
{
3739
Byte[] hmBytes = hmac.ComputeHash(encoder.GetBytes(value));
3840
hash = ToHexString(hmBytes);

0 commit comments

Comments
 (0)