static string Hex2Str(array<byte> b){
char * c = new char(b.GetLength()*2+2);
byte a;
c[0]='0';
c[1]='x';
for(int i=0, j=0; i<b.GetLength(); i++, j++)
{
a = ((byte) (b[i]>>4));
c[j] = (char)( a>9 ? a+0x37:a+0x30);
a= ((byte) (b[i]&0x0f));
c[++j] = (char) (a>9?a+0x37:a+0x30);
}
return c;
}
'Research > Source Repository' 카테고리의 다른 글
Python string bruteforce (0) | 2015.06.05 |
---|---|
Variadic 매크로 (0) | 2014.06.16 |
ThreadPool simple example (0) | 2013.11.03 |
Mutex - Event Simple Code (0) | 2013.10.10 |
simple critical section (0) | 2013.10.09 |