mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-12-05 21:27:13 -06:00
add numwords functionality
This commit is contained in:
18
hex.h
18
hex.h
@@ -10,3 +10,21 @@ static void printhex(const unsigned char *z,size_t l)
|
||||
}
|
||||
printf("]\n");
|
||||
}
|
||||
|
||||
static void printbin(const unsigned char *z,size_t l)
|
||||
{
|
||||
printf("[");
|
||||
for (size_t i = 0;i < l;++i) {
|
||||
printf("%c%c%c%c%c%c%c%c",
|
||||
hext[(*z >> 7) & 1],
|
||||
hext[(*z >> 6) & 1],
|
||||
hext[(*z >> 5) & 1],
|
||||
hext[(*z >> 4) & 1],
|
||||
hext[(*z >> 3) & 1],
|
||||
hext[(*z >> 2) & 1],
|
||||
hext[(*z >> 1) & 1],
|
||||
hext[(*z ) & 1]);
|
||||
++z;
|
||||
}
|
||||
printf("]\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user