mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add binToHex with Poco::Nullable<Poco::Data::Blob> for easy use with public keys
This commit is contained in:
parent
99846b0c61
commit
fbc058cf82
@ -176,6 +176,16 @@ namespace DataTypeConverter
|
||||
return hexString;
|
||||
}
|
||||
|
||||
std::string binToHex(const Poco::Nullable<Poco::Data::BLOB>& nullableBin)
|
||||
{
|
||||
if (nullableBin.isNull()) {
|
||||
return "0x0";
|
||||
}
|
||||
else {
|
||||
return binToHex(nullableBin.value().content().data(), nullableBin.value().content().size());
|
||||
}
|
||||
}
|
||||
|
||||
std::string pubkeyToHex(const unsigned char* pubkey)
|
||||
{
|
||||
auto mm = MemoryManager::getInstance();
|
||||
|
||||
@ -5,9 +5,10 @@
|
||||
#include "../SingletonManager/MemoryManager.h"
|
||||
|
||||
#include "Poco/Timespan.h"
|
||||
#include "Poco/Nullable.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "../SingletonManager/LanguageManager.h"
|
||||
|
||||
|
||||
namespace DataTypeConverter {
|
||||
|
||||
enum NumberParseState
|
||||
@ -26,7 +27,9 @@ namespace DataTypeConverter {
|
||||
|
||||
std::string binToBase64(const MemoryBin* data);
|
||||
|
||||
|
||||
std::string binToHex(const unsigned char* data, size_t size);
|
||||
std::string binToHex(const Poco::Nullable<Poco::Data::BLOB>& nullableBin);
|
||||
inline std::string binToHex(const MemoryBin* data) { return binToHex(data->data(), data->size());}
|
||||
|
||||
//! \param pubkey pointer to array with crypto_sign_PUBLICKEYBYTES size
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user