C# Class Iaik.Utils.ByteHelper

Static class which provides some byte helper functions
Show file Open project: areiter/InMemoryFuzzing

Public Methods

Method Description
ByteArrayToHexString ( byte data ) : string

Converts a byte array to a space seperated hex string

ByteArrayToHexString ( byte data, string seperator ) : string

Converts a byte array to a hex string

ByteArrayToUInt64 ( byte data, int offset, int length ) : System.UInt64

Decodes the number encoded in data as a little endian number

ByteArrayToUInt64 ( byte data, int offset, int length, bool useLittleEndian ) : System.UInt64
ClearBytes ( byte data ) : void
CompareByteArrays ( byte left, byte right ) : bool

Compares the 2 byte arrays and returns if they contain the same data

SerializeToBytes ( ) : byte[]
XORBytes ( byte data, byte key ) : void

XORs all bytes from data with key and saves them to data

Method Details

ByteArrayToHexString() public static method

Converts a byte array to a space seperated hex string
public static ByteArrayToHexString ( byte data ) : string
data byte
return string

ByteArrayToHexString() public static method

Converts a byte array to a hex string
public static ByteArrayToHexString ( byte data, string seperator ) : string
data byte
seperator string seperator which is appended to each hex value (except the last)
return string

ByteArrayToUInt64() public static method

Decodes the number encoded in data as a little endian number
public static ByteArrayToUInt64 ( byte data, int offset, int length ) : System.UInt64
data byte A
offset int A
length int A
return System.UInt64

ByteArrayToUInt64() public static method

public static ByteArrayToUInt64 ( byte data, int offset, int length, bool useLittleEndian ) : System.UInt64
data byte
offset int
length int
useLittleEndian bool
return System.UInt64

ClearBytes() public static method

public static ClearBytes ( byte data ) : void
data byte
return void

CompareByteArrays() public static method

Compares the 2 byte arrays and returns if they contain the same data
public static CompareByteArrays ( byte left, byte right ) : bool
left byte
right byte
return bool

SerializeToBytes() public static method

public static SerializeToBytes ( ) : byte[]
return byte[]

XORBytes() public static method

XORs all bytes from data with key and saves them to data
public static XORBytes ( byte data, byte key ) : void
data byte
key byte
return void