Added Extensions.ToHexString(..)

dev_timestamp
Harald Wolff 2019-08-30 20:55:38 +02:00
parent 6c642dbd96
commit 027a613009
1 changed files with 12 additions and 0 deletions

View File

@ -249,6 +249,18 @@ namespace ln.types
return slice;
}
public static string ToHexString(this byte[] bytes)
{
StringBuilder stringBuilder = new StringBuilder();
for (int n = 0; n < bytes.Length; n ++)
{
stringBuilder.AppendFormat("{0:X2}", bytes[n]);
}
return stringBuilder.ToString();
}
public static string HexDump(this byte[] bytes)
{
StringBuilder stringBuilder = new StringBuilder();