Updated to net9.0

This commit is contained in:
Hondacrx
2025-06-08 18:24:11 -04:00
parent f5f5de1c86
commit d99305d96a
9 changed files with 17 additions and 11 deletions
+7 -4
View File
@@ -25,9 +25,9 @@ namespace System
public static string ToHexString(this byte[] byteArray, bool reverse = false)
{
if (reverse)
return byteArray.Reverse().Aggregate("", (current, b) => current + b.ToString("X2"));
else
return byteArray.Aggregate("", (current, b) => current + b.ToString("X2"));
byteArray.Reverse();
return byteArray.Aggregate("", (current, b) => current + b.ToString("X2"));
}
public static byte[] ToByteArray(this string str, bool reverse = false)
@@ -40,7 +40,10 @@ namespace System
string temp = String.Concat(str[i * 2], str[i * 2 + 1]);
res[i] = Convert.ToByte(temp, 16);
}
return reverse ? res.Reverse().ToArray() : res;
if (reverse)
res.Reverse();
return res;
}
public static byte[] ToByteArray(this string value, char separator)