21 lines
544 B
C#
21 lines
544 B
C#
using System;
|
|
|
|
namespace CLARA.Shared
|
|
{
|
|
public static class Utils
|
|
{
|
|
public static string ToHex(this byte number)
|
|
{
|
|
return ((long)number).ToHex(2);
|
|
}
|
|
public static string ToHex(this int number, byte digits = 4)
|
|
{
|
|
return ((long)number).ToHex(digits);
|
|
}
|
|
public static string ToHex(this long number, byte digits = 4)
|
|
{
|
|
return string.Concat("#", Convert.ToInt64(number).ToString(string.Concat("X", digits.ToString())));
|
|
}
|
|
}
|
|
}
|