void settiestr(char*s){ int i,j,c; i= strlen(s); if((i> 2*MAXLEN)||i%2==1)printusage(),exit(BAD_OPTIONS); tiestrlen= i/2; j= 0; for(i= 0;i<tiestrlen;i++){ tiestr[i]= hexnum(s[j++])<<4; tiestr[i]+= hexnum(s[j++]); } }
int convert_basex(char *str, int base_from) { int nb; int is_neg; int i; int j; j = 0; i = my_strlen(str) -1; is_neg = 0; nb = 0; while (i > -1) { if (str[i] == '-' && str[i + 1] >= '0' && str[i + 1] <= '9') is_neg = 1; if (str[i] >= '0' && str[i] <= '9') { nb += ((str[i] - 48) * (my_power_rec(base_from, j))); } hexnum(str[i], &j, &nb, base_from); --i; ++j; } if (is_neg) nb *= -1; return (nb); }
void unencode_uri_helper(const u8string& src, u8string& dst) { size_t i = 0, size = src.size(); while (i < size) { if (src[i] == '%' && size - i >= 3 && ascii_isxdigit(src[i + 1]) && ascii_isxdigit(src[i + 2])) { dst += char(hexnum(src.substr(i + 1, 2))); i += 3; } else { dst += src[i++]; } } }
int covacc(char usr[],char pwd[],char dst[]) { UCase(usr); char str[100],hex[10]; hexnum(hex); strcat(str,"jepyid"); strcat(str,usr); strcat(str,hex); strcat(str,pwd); strcpy(str,MDString(str)); CutStr(str,20); strcat(dst,"~ghca"); strcat(dst,hex); strcat(dst,"2007"); strcat(dst,str); strcat(dst,usr); return 0; }