C# Class OpenStory.Common.HexExtensions

Provides extension methods for manipulating hexadecimal data.
Datei anzeigen Open project: shoftee/OpenStory

Public Methods

Method Description
ToByte ( this hex ) : byte[]

Constructs a byte array from a string of hexadecimal digits.

ToHex ( this array, bool hyphenate = false ) : string

Constructs a hexadecimal digit string from a byte array.

Method Details

ToByte() public static method

Constructs a byte array from a string of hexadecimal digits.
Thrown if is . Thrown if is not of even length, /// OR, if contains characters that don't correspond to hexadecimal digits. ///
public static ToByte ( this hex ) : byte[]
hex this The string to translate to bytes.
return byte[]

ToHex() public static method

Constructs a hexadecimal digit string from a byte array.
Thrown if is .
public static ToHex ( this array, bool hyphenate = false ) : string
array this The byte array to translate to hexadecimal characters.
hyphenate bool Whether to add hyphens between the byte hex.
return string