X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Futils.c;h=459afed58007d4e289d8b6c16308df76bcf5c666;hb=48dc900a804537aa5b36f203c4c4ba6c0bcb2f20;hp=33e55c7eadfe9338b36715f29fcb905e4e701a64;hpb=59c94590b849529da4021750018833221bdfab5b;p=ashd.git 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)