diff --git a/damus-c/hex.c b/damus-c/hex.c index 4f07c8e4..4ee54397 100644 --- a/damus-c/hex.c +++ b/damus-c/hex.c @@ -39,15 +39,6 @@ bool hex_decode(const char *str, size_t slen, void *buf, size_t bufsize) return slen == 0 && bufsize == 0; } -static char hexchar(unsigned int val) -{ - if (val < 10) - return '0' + val; - if (val < 16) - return 'a' + val - 10; - abort(); -} - bool hex_encode(const void *buf, size_t bufsize, char *dest, size_t destsize) { size_t i; diff --git a/damus-c/hex.h b/damus-c/hex.h index 117f6a3a..75f0ad49 100644 --- a/damus-c/hex.h +++ b/damus-c/hex.h @@ -70,4 +70,15 @@ static inline size_t hex_data_size(size_t strlen) { return strlen / 2; } + +static inline char hexchar(unsigned int val) +{ + if (val < 10) + return '0' + val; + if (val < 16) + return 'a' + val - 10; + abort(); +} + + #endif /* CCAN_HEX_H */