0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-04-02 16:00:36 +02:00

ircd::base: Simplify internal namespace related.

This commit is contained in:
Jason Volk 2020-08-06 20:19:12 -07:00
parent a6f9684456
commit 52d590b832

View file

@ -12,14 +12,10 @@
#include <boost/archive/iterators/binary_from_base64.hpp>
#include <boost/archive/iterators/transform_width.hpp>
namespace [[gnu::visibility("hidden")]] ircd
namespace ircd::base
{
thread_local char base_conv_tmp_buf[64_KiB];
}
namespace [[gnu::visibility("default")]] ircd
{
// this stub needed for clang
[[gcc::visibility("internal")]]
thread_local char conv_tmp_buf[64_KiB];
}
ircd::string_view
@ -48,39 +44,39 @@ ircd::string_view
ircd::b58tob64_unpadded(const mutable_buffer &out,
const string_view &in)
{
if(unlikely(b58decode_size(in) > size(base_conv_tmp_buf)))
if(unlikely(b58decode_size(in) > size(base::conv_tmp_buf)))
throw error
{
"String too large for conversion at this time."
};
return b64encode_unpadded(out, b58decode(base_conv_tmp_buf, in));
return b64encode_unpadded(out, b58decode(base::conv_tmp_buf, in));
}
ircd::string_view
ircd::b58tob64(const mutable_buffer &out,
const string_view &in)
{
if(unlikely(b58decode_size(in) > size(base_conv_tmp_buf)))
if(unlikely(b58decode_size(in) > size(base::conv_tmp_buf)))
throw error
{
"String too large for conversion at this time."
};
return b64encode(out, b58decode(base_conv_tmp_buf, in));
return b64encode(out, b58decode(base::conv_tmp_buf, in));
}
ircd::string_view
ircd::b64tob58(const mutable_buffer &out,
const string_view &in)
{
if(unlikely(b64decode_size(in) > size(base_conv_tmp_buf)))
if(unlikely(b64decode_size(in) > size(base::conv_tmp_buf)))
throw error
{
"String too large for conversion at this time."
};
return b58encode(out, b64decode(base_conv_tmp_buf, in));
return b58encode(out, b64decode(base::conv_tmp_buf, in));
}
namespace [[gnu::visibility("hidden")]] ircd