void StringByteConverter::hexStringToBytes ( const string  hexString,
char *  bytes,
int *  length 
) [static]

Definition at line 24 of file StringByteConverter.cpp.

00024                                                                                                       {
00025         /*declaration block*/
00026         unsigned int i = 0;
00027         char byteWord[2];
00028         /*do the transforming*/
00029         while ( i < hexString.length() ) {
00030                 /*1 byte consists of 2 string chars*/
00031                 byteWord[0] = hexString[i];
00032                 byteWord[1] = hexString[i+1];
00033                 bytes[i/2] = (char)strtol(byteWord, NULL, 16);
00034                 i++;
00035                 i++;
00036         }
00037         if (length!=0) {
00038                 *length = hexString.length()/2;
00039         }
00040 }


Generated on Wed Jun 25 14:47:15 2008 for keyvil by  doxygen 1.5.1