d23c2b3df690703881892e16e0f9db0baaa4e16d kent Sun Mar 31 10:44:39 2013 -0700 Added hexBinaryString and replaced nibbleToHex routine with hexTab lookup. diff --git src/inc/hex.h src/inc/hex.h index ba96653..8948b37 100644 --- src/inc/hex.h +++ src/inc/hex.h @@ -1,23 +1,27 @@ #ifndef HEX_H #define HEX_H char nibbleToHex(char n); /* convert nibble to hexidecimal character. 0 <= n <= 15. */ void byteToHex(unsigned char n, char *hex); /* convert byte to two hexidecimal characters. 0 <= n <= 255. */ char *byteToHexString(unsigned char n); /* convert byte to hexidecimal string. 0 <= n <= 255. */ +void hexBinaryString(unsigned char *in, int inSize, char *out, int outSize); +/* Convert possibly long binary string to hex string. + * Out size needs to be at least 2x inSize+1 */ + /* Reverse Functions */ char hexToNibble(char n); /* convert hexidecimal character to nibble. 0-9a-f. */ unsigned char hexToByte(char *hex); /* convert byte to hexidecimal characters. 0 <= n <= 255. */ #endif /* HEX_H */