mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-05-14 05:52:49 +00:00
add numwords functionality
This commit is contained in:
parent
39b173aa3d
commit
92d0e26b5d
2 changed files with 136 additions and 12 deletions
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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue