mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-01 15:49:11 +00:00
ToHex() should be uppercase by default
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user