Energy Core Library
Energy.Base.Hex Class Reference

Hexadecimal functions More...

Classes

class  ByteArray
 Byte array which can be serialized and deserialized with hexadecimal string More...
 
class  PrintFormatSettings
 Format settings for printing More...
 

Static Public Member Functions

static char ByteToASCII (byte b)
 Convert byte to ASCII character More...
 
static byte [] HexToArray (string hex)
 Convert hexadecimal string to byte array More...
 
static string ArrayToHex (byte[] array, string space)
 Convert byte array to hexadecimal string More...
 
static string ArrayToHex (byte[] array)
 Convert byte array to hexadecimal string More...
 
static string ByteToHex (byte value)
 Represent byte as two-digit hexadecimal value. More...
 
static string ByteArrayToHex (byte[] array)
 Represent bytes as hexadecimal string More...
 
static byte [] HexToByteArray (string hex)
 Convert hex to byte array More...
 
static byte [] HexToByteArray (string hex, string[] prefix)
 Convert hex to byte array More...
 
static string IntegerToHex (int value, int size, bool uppperCase)
 
static string IntegerToHex (int value)
 
static string IntegerToHex (int value, bool uppperCase)
 
static string IntegerToHex (int value, int size)
 
static ulong Parse (string hex)
 Parse hexadecimal string up to 64-bit value More...
 
static string Print (byte[] array, PrintFormatSettings printFormatSettings)
 Pretty print byte array in hexadecimal form More...
 
static string Print (byte[] array, int lineSize, int groupSize, bool upperCase, int wordSize, int offsetSize, string representationMode, string elementSeparator, string groupSeparator, string offsetSeparator, string representationSeparator)
 Pretty print byte array in hexadecimal form More...
 
static string Print (byte[] array, int lineSize, int groupSize, int offsetSize, int wordSize, bool representation)
 Pretty print byte array in hexadecimal form More...
 
static string Print (byte[] array, int lineSize, int groupSize, bool representation)
 Pretty print byte array in hexadecimal form More...
 
static string Print (byte[] array, int lineSize, int groupSize)
 Pretty print byte array in hexadecimal form with text represenation More...
 
static string Print (byte[] array, int lineSize)
 Pretty print byte array in hexadecimal form with text represenation More...
 
static string Print (byte[] array)
 Pretty print byte array in hexadecimal form with text represenation More...
 
static string GetRandomHex (int length)
 Generate random hexadecimal number. More...
 
static string Random ()
 Generate random hexadecimal number. More...
 
static bool IsHex (string value, string[] prefixArray, bool removeWhite)
 Check if text is a hexadecimal number string. More...
 
static bool IsHex (string value, string[] prefixArray)
 Check if text is a hexadecimal number string. More...
 
static bool IsHex (string value)
 Check if text is a hexadecimal number string. More...
 

Detailed Description

Hexadecimal functions

Member Function Documentation

◆ ArrayToHex() [1/2]

static string Energy.Base.Hex.ArrayToHex ( byte []  array,
string  space 
)
static

Convert byte array to hexadecimal string

Parameters
arrayByte array
spaceOptional hexadecimal separator
Returns
string

◆ ArrayToHex() [2/2]

static string Energy.Base.Hex.ArrayToHex ( byte []  array)
static

Convert byte array to hexadecimal string

Parameters
arrayByte array
Returns
string

◆ ByteArrayToHex()

static string Energy.Base.Hex.ByteArrayToHex ( byte []  array)
static

Represent bytes as hexadecimal string

Parameters
array
Returns

◆ ByteToASCII()

static char Energy.Base.Hex.ByteToASCII ( byte  b)
static

Convert byte to ASCII character

Parameters
bByte
Returns
Character

◆ ByteToHex()

static string Energy.Base.Hex.ByteToHex ( byte  value)
static

Represent byte as two-digit hexadecimal value.

Parameters
value
Returns

◆ GetRandomHex()

static string Energy.Base.Hex.GetRandomHex ( int  length)
static

Generate random hexadecimal number.

Parameters
lengthNumber of hexadecimal characters
Returns

◆ HexToArray()

static byte [] Energy.Base.Hex.HexToArray ( string  hex)
static

Convert hexadecimal string to byte array

Parameters
hexHexadecimal string
Returns
Byte array

◆ HexToByteArray() [1/2]

static byte [] Energy.Base.Hex.HexToByteArray ( string  hex)
static

Convert hex to byte array

Parameters
hex
Returns

◆ HexToByteArray() [2/2]

static byte [] Energy.Base.Hex.HexToByteArray ( string  hex,
string []  prefix 
)
static

Convert hex to byte array

Parameters
hex
prefixOptional prefix list of hexadecimal number
Returns

◆ IntegerToHex() [1/4]

static string Energy.Base.Hex.IntegerToHex ( int  value,
int  size,
bool  uppperCase 
)
static

◆ IntegerToHex() [2/4]

static string Energy.Base.Hex.IntegerToHex ( int  value)
static

◆ IntegerToHex() [3/4]

static string Energy.Base.Hex.IntegerToHex ( int  value,
bool  uppperCase 
)
static

◆ IntegerToHex() [4/4]

static string Energy.Base.Hex.IntegerToHex ( int  value,
int  size 
)
static

◆ IsHex() [1/3]

static bool Energy.Base.Hex.IsHex ( string  value,
string []  prefixArray,
bool  removeWhite 
)
static

Check if text is a hexadecimal number string.

Parameters
value
prefixArray
removeWhite
Returns

◆ IsHex() [2/3]

static bool Energy.Base.Hex.IsHex ( string  value,
string []  prefixArray 
)
static

Check if text is a hexadecimal number string.

Parameters
value
prefixArray
Returns

◆ IsHex() [3/3]

static bool Energy.Base.Hex.IsHex ( string  value)
static

Check if text is a hexadecimal number string.

Parameters
value
Returns

◆ Parse()

static ulong Energy.Base.Hex.Parse ( string  hex)
static

Parse hexadecimal string up to 64-bit value

Parameters
hexHexadecimal
Returns
Long number

◆ Print() [1/7]

static string Energy.Base.Hex.Print ( byte []  array,
PrintFormatSettings  printFormatSettings 
)
static

Pretty print byte array in hexadecimal form

Parameters
arrayInput byte array
printFormatSettingsFormat settings
Returns

◆ Print() [2/7]

static string Energy.Base.Hex.Print ( byte []  array,
int  lineSize,
int  groupSize,
bool  upperCase,
int  wordSize,
int  offsetSize,
string  representationMode,
string  elementSeparator,
string  groupSeparator,
string  offsetSeparator,
string  representationSeparator 
)
static

Pretty print byte array in hexadecimal form

Parameters
arrayInput byte array
lineSizeNumber of bytes in one line
groupSizeNumber of bytes in every group
upperCaseUse uppercase letters in hexadecimal representation
wordSizeGroup bytes together, i.e. 2 for 16-bit, 4 for 32-bit, etc.
offsetSizeUse offset prefix of hexadecimals length
representationModeInclude optional representation
elementSeparatorElement separator
groupSeparatorGroup separator
offsetSeparatorOffset separator
representationSeparatorRepresentation separator
Returns

◆ Print() [3/7]

static string Energy.Base.Hex.Print ( byte []  array,
int  lineSize,
int  groupSize,
int  offsetSize,
int  wordSize,
bool  representation 
)
static

Pretty print byte array in hexadecimal form

Parameters
arrayByte array
lineSizeNumber of bytes in one line
groupSizePut extra space between each division columns
offsetSizeInclude offset with specified dimension in bytes or -1 for autosize
wordSizeGroup bytes together 2 for words, 4 for double words, etc.
representationInclude character representation
Returns
Text representation

◆ Print() [4/7]

static string Energy.Base.Hex.Print ( byte []  array,
int  lineSize,
int  groupSize,
bool  representation 
)
static

Pretty print byte array in hexadecimal form

Parameters
arrayByte array
lineSizeNumber of bytes in one line
groupSizePut extra space between each division columns
representationCharacter representation
Returns
Text representation

◆ Print() [5/7]

static string Energy.Base.Hex.Print ( byte []  array,
int  lineSize,
int  groupSize 
)
static

Pretty print byte array in hexadecimal form with text represenation

Parameters
arrayByte array
lineSizeNumber of bytes in one line
groupSizePut extra space between each division columns
Returns
Text representation

◆ Print() [6/7]

static string Energy.Base.Hex.Print ( byte []  array,
int  lineSize 
)
static

Pretty print byte array in hexadecimal form with text represenation

Parameters
arrayByte array
lineSizeNumber of bytes in one line
Returns
Text representation

◆ Print() [7/7]

static string Energy.Base.Hex.Print ( byte []  array)
static

Pretty print byte array in hexadecimal form with text represenation

Parameters
arrayByte array
Returns
Text representation

◆ Random()

static string Energy.Base.Hex.Random ( )
static

Generate random hexadecimal number.

Returns

The documentation for this class was generated from the following file: