mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
s and i keys for all addresses
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
@@ -9,14 +9,6 @@
|
||||
#ifndef TAG_H__
|
||||
#define TAG_H__
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013-2017, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
* See full license text in LICENSE file at top of project tree
|
||||
*/
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <string.h>
|
||||
#include <openssl/rand.h>
|
||||
@@ -64,17 +56,17 @@ namespace data {
|
||||
RAND_bytes(m_Buf, sz);
|
||||
}
|
||||
|
||||
std::string ToBase64 () const
|
||||
std::string ToBase64 (size_t len = sz) const
|
||||
{
|
||||
char str[sz*2];
|
||||
size_t l = i2p::data::ByteStreamToBase64 (m_Buf, sz, str, sz*2);
|
||||
size_t l = i2p::data::ByteStreamToBase64 (m_Buf, len, str, sz*2);
|
||||
return std::string (str, str + l);
|
||||
}
|
||||
|
||||
std::string ToBase32 () const
|
||||
std::string ToBase32 (size_t len = sz) const
|
||||
{
|
||||
char str[sz*2];
|
||||
size_t l = i2p::data::ByteStreamToBase32 (m_Buf, sz, str, sz*2);
|
||||
size_t l = i2p::data::ByteStreamToBase32 (m_Buf, len, str, sz*2);
|
||||
return std::string (str, str + l);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user