Skip to content

Commit a675bb0

Browse files
committed
BPId remove static hexEncode function
1 parent 91ef39b commit a675bb0

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/bpid/bpid.cpp

+2-12
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,10 @@
1010

1111
#include "bpid.h"
1212
#include "../sha256/SHA256.h"
13+
#include "../hex/hex.h"
1314

1415
namespace arduino { namespace bpid {
1516

16-
static String hexEncode(uint8_t* in, uint32_t size) {
17-
String out;
18-
out.reserve((size * 2) + 1);
19-
20-
char *ptr = out.begin();
21-
for (uint32_t i = 0; i < size; i++) {
22-
ptr += sprintf(ptr, "%02X", in[i]);
23-
}
24-
return String(out.c_str());
25-
}
26-
2717
bool get(uint8_t* in, uint32_t size) {
2818
if (size < BOARD_PROVISIONING_ID_SIZE) {
2919
return false;
@@ -50,7 +40,7 @@ namespace arduino { namespace bpid {
5040
}
5141
uint8_t out[SHA256::HASH_SIZE];
5242
arduino::sha256::oneshot(data, sizeof(data), out);
53-
return hexEncode(out, sizeof(out));
43+
return arduino::hex::encode(out, sizeof(out));
5444
}
5545

5646
}} // arduino::bpid

0 commit comments

Comments
 (0)