Skip to content
Snippets Groups Projects
Unverified Commit 43d12f9f authored by Douglas Engels's avatar Douglas Engels
Browse files

Added bintohexfunc

parent fc9df0ff
Branches
Tags
2 merge requests!58Onboarding screens swift ui merge dev,!35Resolve "SMIME Support"
......@@ -469,3 +469,17 @@ void deallocate_str_arr(char **arr, int len)
free(arr);
}
char *bin_to_hex ( unsigned char *bin, int len)
{
unsigned char buf[3];
char *res = malloc(2*len+1);
for (int i =0;i<len;i++)
{
sprintf(buf, "%02x", bin[i]);
res[i*2]=buf[0];
res[i*2+1]=buf[1];
}
res[len*2]=0;
return res;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment