`ToHex()` should be uppercase by default

pull/1107/head^2
Tyrrrz 1 year ago
parent c9447c5c8f
commit b224fca6c0

@ -4,12 +4,16 @@ namespace DiscordChatExporter.Core.Utils.Extensions;
public static class BinaryExtensions
{
public static string ToHex(this byte[] data)
public static string ToHex(this byte[] data, bool isUpperCase = true)
{
var buffer = new StringBuilder(2 * data.Length);
foreach (var b in data)
buffer.Append(b.ToString("x2"));
{
buffer.Append(
b.ToString(isUpperCase ? "X2" : "x2")
);
}
return buffer.ToString();
}

Loading…
Cancel
Save