C# Class NSoft.NFramework.Tools.HexTextTool

16진수 문자열에 대한 변환을 수행하는 Helper Class 입니다.
显示文件 Open project: debop/NFramework Class Usage Examples

Public Methods

Method Description
GetBytesFromHexString ( this hexString ) : byte[]

16진수를 표현한 문자열을 byte 배열로 변환한다.

GetBytesFromHexString ( this hexString, string delimiter ) : byte[]

16진수 byte 배열을 BitConverter를 통해서 변환된 문자열은 '-' 를 구분자로 하고 있으므로 다시 byte 배열로 바꿀 때에는 구분자로 '-' 를 주어야 한다.

GetHexDumpString ( this stream ) : string

Stream 객체를 Hex Code로 Dump해서 문자열로 만든다. Ultra Edit의 Hex Code Editor에 나타내는 것 처럼

GetHexStringFromBytes ( this bytes, string delimiter = null ) : string

Byte 배열을 Hex 형식의 string으로 변환한다.

byte.AsString("X2") 를 사용한다.

HexToInt ( this h ) : int

char 를 int 수형으로 변환한다. ('a' => 10, '8' => 8)

IntToHex ( this n ) : char

지정한 Integer 값을 해당 character로 변경합니다. 예: 6 => '6', 12 => 'c' 로

Method Details

GetBytesFromHexString() public static method

16진수를 표현한 문자열을 byte 배열로 변환한다.
public static GetBytesFromHexString ( this hexString ) : byte[]
hexString this 16진수 포맷의 문자열
return byte[]

GetBytesFromHexString() public static method

16진수 byte 배열을 BitConverter를 통해서 변환된 문자열은 '-' 를 구분자로 하고 있으므로 다시 byte 배열로 바꿀 때에는 구분자로 '-' 를 주어야 한다.
public static GetBytesFromHexString ( this hexString, string delimiter ) : byte[]
hexString this 16진수 형식의 문자열
delimiter string 바이트문자열 구분자
return byte[]

GetHexDumpString() public static method

Stream 객체를 Hex Code로 Dump해서 문자열로 만든다. Ultra Edit의 Hex Code Editor에 나타내는 것 처럼
public static GetHexDumpString ( this stream ) : string
stream this 원본 데이타
return string

GetHexStringFromBytes() public static method

Byte 배열을 Hex 형식의 string으로 변환한다.
byte.AsString("X2") 를 사용한다.
public static GetHexStringFromBytes ( this bytes, string delimiter = null ) : string
bytes this 바이트 배열
delimiter string 구분자
return string

HexToInt() public static method

char 를 int 수형으로 변환한다. ('a' => 10, '8' => 8)
public static HexToInt ( this h ) : int
h this
return int

IntToHex() public static method

지정한 Integer 값을 해당 character로 변경합니다. 예: 6 => '6', 12 => 'c' 로
public static IntToHex ( this n ) : char
n this
return char