enhance hex_decode
All checks were successful
Test and Deploy / test (push) Successful in 12s
Test and Deploy / docs (push) Successful in 15s

This commit is contained in:
2024-04-11 07:17:42 -07:00
parent 0318221f3f
commit e622107f07
3 changed files with 26 additions and 7 deletions

View File

@ -349,6 +349,13 @@ void test_crypto() {
}
free(s);
// leading 0x
s = hex_decode("0xf00f5", &s_sz);
for (size_t i = 0; i < 3; ++i) {
assert(s[i] == h2[i]);
}
free(s);
s = hex_encode(h, 4);
assert(strcmp(s, "deadbeef") == 0);
free(s);