We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec19cb8 commit 033a6d9Copy full SHA for 033a6d9
src/bpid/bpid.cpp
@@ -10,20 +10,10 @@
10
11
#include "bpid.h"
12
#include "../sha256/SHA256.h"
13
+#include "../hex/hex.h"
14
15
namespace arduino { namespace bpid {
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
27
bool get(uint8_t* in, uint32_t size) {
28
if (size < BOARD_PROVISIONING_ID_SIZE) {
29
return false;
@@ -50,7 +40,7 @@ namespace arduino { namespace bpid {
50
40
}
51
41
uint8_t out[SHA256::HASH_SIZE];
52
42
arduino::sha256::oneshot(data, sizeof(data), out);
53
- return hexEncode(out, sizeof(out));
43
+ return arduino::hex::encode(out, sizeof(out));
54
44
55
45
56
46
}} // arduino::bpid
0 commit comments