This commit is contained in:
rnchg
2026-07-14 21:33:39 +08:00
commit 4b28b75e57
2227 changed files with 768410 additions and 0 deletions
@@ -0,0 +1,24 @@
namespace FASS.Extend.Car.Fairyland.Plc
{
public static class Utility
{
public static string ByteArrayToHexString(byte[]? byteArray, string separator = "")
{
if (byteArray is null)
{
return string.Empty;
}
return string.Join(separator, byteArray.Select(t => t.ToString("X2")));
}
public static byte XOR(byte[] byteArray)
{
byte xor = 0;
for (int i = 0; i < byteArray.Length; i++)
{
xor ^= byteArray[i];
}
return xor;
}
}
}