using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
namespace FStore.Utils
{
///
/// Class containing utilities used internally and available for external use
///
public static class PublicUtils
{
///
/// Calculates the HEX values of an array of bytes and produces a hex string
///
/// The byte array to calculate the Hex values for
/// Whether to hyphenate the Hex values
///
public static string UAsHex(this byte[] data, bool hyphenate = false)
{
StringBuilder sb = new StringBuilder();
foreach (byte by in data)
{
sb.Append(by.ToString("X2"));
if (hyphenate)
sb.Append("-");
}
return sb.ToString().TrimEnd('-');
}
}
}