0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd: Add b64encoded_unpadded variant.

This commit is contained in:
Jason Volk 2017-10-01 22:45:18 -07:00
parent 7745082fb0
commit 0eb10c0495
2 changed files with 8 additions and 0 deletions

View file

@ -50,6 +50,7 @@ namespace ircd
// Binary <-> Base64 conversion suite
string_view b64encode(const mutable_buffer &out, const const_raw_buffer &in);
string_view b64encode_unpadded(const mutable_buffer &out, const const_raw_buffer &in);
}
namespace ircd

View file

@ -561,6 +561,13 @@ ircd::try_lex_cast<long double>(const string_view &s)
// ircd/stringops.h
//
ircd::string_view
ircd::b64encode_unpadded(const mutable_buffer &out,
const const_raw_buffer &in)
{
return rstrip(b64encode(out, in), '=');
}
ircd::string_view
ircd::b64encode(const mutable_buffer &out,
const const_raw_buffer &in)