Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions bench/algorithm/json-serde/1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ private static void PrintHash(string s)
{
using var hasher = MD5.Create();
var hash = hasher.ComputeHash(Encoding.UTF8.GetBytes(s));
Console.WriteLine(ToHexString(hash));
}

static string ToHexString(byte[] ba)
{
StringBuilder hex = new StringBuilder(ba.Length * 2);
foreach (byte b in ba)
hex.AppendFormat("{0:x2}", b);
return hex.ToString();
Console.WriteLine(Convert.ToHexStringLower(hash));
}
}
2 changes: 1 addition & 1 deletion bench/algorithm/json-serde/2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static void PrintHash(byte[] bytes)
{
using MD5 hasher = MD5.Create();
byte[] hash = hasher.ComputeHash(bytes);
Console.WriteLine(Convert.ToHexString(hash).ToLower());
Console.WriteLine(Convert.ToHexStringLower(hash));
}
}
internal sealed class GeoData
Expand Down
12 changes: 1 addition & 11 deletions bench/algorithm/mandelbrot/1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void Main(string[] args)

using var hasher = MD5.Create();
var hash = hasher.ComputeHash(data);
Console.WriteLine(ToHexString(hash));
Console.WriteLine(Convert.ToHexStringLower(hash));
}

static byte mbrot8(double[] cr, double civ)
Expand Down Expand Up @@ -118,14 +118,4 @@ static void mul(Span<double> a, Span<double> b, Span<double> r)
r[i] = a[i] * b[i];
}
}

static string ToHexString(byte[] ba)
{
StringBuilder hex = new StringBuilder(ba.Length * 2);
foreach (byte b in ba)
{
hex.AppendFormat("{0:x2}", b);
}
return hex.ToString();
}
}
12 changes: 1 addition & 11 deletions bench/algorithm/mandelbrot/2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void Main(string[] args)

using var hasher = MD5.Create();
var hash = hasher.ComputeHash(data);
Console.WriteLine(ToHexString(hash));
Console.WriteLine(Convert.ToHexStringLower(hash));
}

static byte mbrot8((Vector<double>, Vector<double>) cr, double civ)
Expand Down Expand Up @@ -103,14 +103,4 @@ static byte mbrot8((Vector<double>, Vector<double>) cr, double civ)
}
return accu;
}

static string ToHexString(byte[] ba)
{
StringBuilder hex = new StringBuilder(ba.Length * 2);
foreach (byte b in ba)
{
hex.AppendFormat("{0:x2}", b);
}
return hex.ToString();
}
}
12 changes: 1 addition & 11 deletions bench/algorithm/mandelbrot/3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static void Main(string[] args)

using var hasher = MD5.Create();
var hash = hasher.ComputeHash(data);
Console.WriteLine(ToHexString(hash));
Console.WriteLine(Convert.ToHexStringLower(hash));
}

unsafe static byte mbrot8(F64x8 cr, double civ)
Expand Down Expand Up @@ -144,14 +144,4 @@ unsafe static byte mbrot8(F64x8 cr, double civ)
}
return accu;
}

static string ToHexString(byte[] ba)
{
StringBuilder hex = new StringBuilder(ba.Length * 2);
foreach (byte b in ba)
{
hex.AppendFormat("{0:x2}", b);
}
return hex.ToString();
}
}
12 changes: 1 addition & 11 deletions bench/algorithm/mandelbrot/9-m.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,7 @@ public static unsafe void Main(string[] args)
});
using var hasher = MD5.Create();
var hash = hasher.ComputeHash(data);
Console.WriteLine(ToHexString(hash));
Console.WriteLine(Convert.ToHexStringLower(hash));
}
}

static string ToHexString(byte[] ba)
{
StringBuilder hex = new StringBuilder(ba.Length * 2);
foreach (byte b in ba)
{
hex.AppendFormat("{0:x2}", b);
}
return hex.ToString();
}
}
12 changes: 1 addition & 11 deletions bench/algorithm/mandelbrot/9.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,7 @@ public static unsafe void Main(string[] args)
}
using var hasher = MD5.Create();
var hash = hasher.ComputeHash(data);
Console.WriteLine(ToHexString(hash));
Console.WriteLine(Convert.ToHexStringLower(hash));
}
}

static string ToHexString(byte[] ba)
{
StringBuilder hex = new StringBuilder(ba.Length * 2);
foreach (byte b in ba)
{
hex.AppendFormat("{0:x2}", b);
}
return hex.ToString();
}
}
Loading