From 0eb10c049517557c4d5849cb04498e36d738de3b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 1 Oct 2017 22:45:18 -0700 Subject: [PATCH] ircd: Add b64encoded_unpadded variant. --- include/ircd/lex_cast.h | 1 + ircd/lexical.cc | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/ircd/lex_cast.h b/include/ircd/lex_cast.h index 52c15fce3..f36c2c717 100644 --- a/include/ircd/lex_cast.h +++ b/include/ircd/lex_cast.h @@ -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 diff --git a/ircd/lexical.cc b/ircd/lexical.cc index 49d968504..d82bb2326 100644 --- a/ircd/lexical.cc +++ b/ircd/lexical.cc @@ -561,6 +561,13 @@ ircd::try_lex_cast(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)