C# 클래스 NSoft.NFramework.Tools.HexTextTool

16진수 문자열에 대한 변환을 수행하는 Helper Class 입니다.
파일 보기 프로젝트 열기: debop/NFramework 1 사용 예제들

공개 메소드들

메소드 설명
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' 로

메소드 상세

GetBytesFromHexString() 공개 정적인 메소드

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

GetBytesFromHexString() 공개 정적인 메소드

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

GetHexDumpString() 공개 정적인 메소드

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

GetHexStringFromBytes() 공개 정적인 메소드

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

HexToInt() 공개 정적인 메소드

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

IntToHex() 공개 정적인 메소드

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