X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=lib%2Futils.c;h=459afed58007d4e289d8b6c16308df76bcf5c666;hp=33e55c7eadfe9338b36715f29fcb905e4e701a64;hb=4dc7f716a7b4be064ecf86f6e1444b7b39dfdfe7;hpb=f9a65eb249034b28f604dce099deb1a622d373cf diff --git a/lib/utils.c b/lib/utils.c index 33e55c7..459afed 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -307,6 +307,14 @@ char *base64decode(char *data, size_t *datalen) return(buf.b); } +int hexdigit(char c) +{ + if((c >= '0') && (c <= '9')) return(c - '0'); + else if((c >= 'a') && (c <= 'f')) return(c - 'a' + 10); + else if((c >= 'A') && (c <= 'F')) return(c - 'A' + 10); + return(-1); +} + static int btheight(struct btree *tree) { if(tree == NULL)