repo.or.cz
/
RRG-proxmark3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
R&Y: Added DAY RTA Tapp Card and Additional BKK BEM Stored Value Card AIDs to `aid_de...
[RRG-proxmark3.git]
/
tools
/
cryptorf
/
util.c
blob
81db9f6ef7e4811acf59c3a6c338e2231d393223
1
#include
"util.h"
2
#include <stdio.h>
3
4
void
num_to_bytes
(
uint64_t
n
,
size_t
len
,
uint8_t
*
dst
) {
5
while
(
len
--) {
6
dst
[
len
] = (
uint8_t
)
n
;
7
n
>>=
8
;
8
}
9
}
10
11
void
print_bytes
(
const uint8_t
*
pbtData
,
const size_t
szLen
) {
12
size_t
uiPos
;
13
for
(
uiPos
=
0
;
uiPos
<
szLen
;
uiPos
++) {
14
printf
(
"%02x "
,
pbtData
[
uiPos
]);
15
if
(
uiPos
>
20
) {
16
printf
(
"..."
);
17
break
;
18
}
19
}
20
printf
(
"
\n
"
);
21
}