ByteArray.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * ByteArray.h
8  *
9  ****/
10 
11 #pragma once
12 
13 #include <WString.h>
14 #include <Data/HexString.h>
15 #include <iterator>
16 
17 namespace Crypto
18 {
24 template <size_t size_> using ByteArray = std::array<uint8_t, size_>;
25 
26 template <size_t size_> String toString(const ByteArray<size_>& array, char separator = '\0')
27 {
28  return makeHexString(array.data(), array.size(), separator);
29 }
30 
31 } // namespace Crypto
The String class.
Definition: WString.h:136
std::array< uint8_t, size_ > ByteArray
Class template for fixed byte array.
Definition: ByteArray.h:32
String makeHexString(const void *data, unsigned length, char separator='\0')
Convert data into a hexadecimal string representation.
String toString(const ByteArray< size_ > &array, char separator='\0')
Definition: ByteArray.h:34
Definition: Blake2s.h:18