diff options
Diffstat (limited to 'sha-example.c')
-rw-r--r-- | sha-example.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sha-example.c b/sha-example.c index a4818460..8f434968 100644 --- a/sha-example.c +++ b/sha-example.c @@ -8,14 +8,11 @@ static void display_hex(unsigned length, uint8_t *data) { - static const char digits[16] = "0123456789abcdef"; unsigned i; for (i = 0; i<length; i++) - { - uint8_t byte = data[i]; - printf("%c%c ", digits[(byte / 16) & 0xf], digits[byte & 0xf]); - } + printf("%2x ", data[i]); + printf("\n"); } |