summaryrefslogtreecommitdiff
path: root/sha-example.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2003-04-22 21:54:09 +0200
committerNiels Möller <nisse@lysator.liu.se>2003-04-22 21:54:09 +0200
commit9f3ff09fd8cbc67310ff6ceb2e0e58a52548dc59 (patch)
treee49269856317ad211b83915bf59ec56ce18df3d2 /sha-example.c
parent8dfc66bf0a1d1a2f6f9ebbbfe2dd4eef81e8f612 (diff)
downloadnettle-9f3ff09fd8cbc67310ff6ceb2e0e58a52548dc59.tar.gz
* sha-example.c (display_hex): Simplified by using printf better.
Rev: src/nettle/ChangeLog:1.191 Rev: src/nettle/sha-example.c:1.2
Diffstat (limited to 'sha-example.c')
-rw-r--r--sha-example.c7
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");
}