forked from Gericom/EveryFileExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HexUtil.cs
35 lines (34 loc) · 891 Bytes
/
HexUtil.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LibEveryFileExplorer
{
public class HexUtil
{
public static String GetHexReverse(sbyte Value)
{
return (Value & 0xFF).ToString("X2");
}
public static String GetHexReverse(byte Value)
{
return Value.ToString("X2");
}
public static String GetHexReverse(short Value)
{
return BitConverter.ToString(BitConverter.GetBytes(Value)).Replace("-", "");
}
public static String GetHexReverse(ushort Value)
{
return BitConverter.ToString(BitConverter.GetBytes(Value)).Replace("-", "");
}
public static String GetHexReverse(int Value)
{
return BitConverter.ToString(BitConverter.GetBytes(Value)).Replace("-", "");
}
public static String GetHexReverse(uint Value)
{
return BitConverter.ToString(BitConverter.GetBytes(Value)).Replace("-", "");
}
}
}