add hex_to_str

This commit is contained in:
2024-03-29 07:18:01 -07:00
parent f60bea0fdd
commit 0408b8d499
4 changed files with 28 additions and 0 deletions

View File

@ -349,6 +349,14 @@ void test_crypto() {
s = hex_encode(h, 4);
assert(strcmp(s, "DEADBEEF") == 0);
free(s);
// "Sup?"
unsigned char hexsup[4] = {
0x53, 0x75, 0x70, 0x3F
};
s = hex_to_str(hexsup, 4);
assert(strcmp(s, "Sup?") == 0);
free(s);
}
#if defined(__APPLE__) || defined(__MACH__)