Rearranged solution, added CLARA.Shared project.
This commit is contained in:
7
CLARA.Shared/CLARA.Shared.csproj
Normal file
7
CLARA.Shared/CLARA.Shared.csproj
Normal file
@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
20
CLARA.Shared/Utils.cs
Normal file
20
CLARA.Shared/Utils.cs
Normal file
@ -0,0 +1,20 @@
|
||||
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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user