summaryrefslogtreecommitdiffstats
path: root/src/base64.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/base64.h')
-rw-r--r--src/base64.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/base64.h b/src/base64.h
index 1bd51af..8789427 100644
--- a/src/base64.h
+++ b/src/base64.h
@@ -204,18 +204,19 @@ template <typename InputIt> std::string decode(InputIt first, InputIt last) {
}
template <typename InputIt>
-StringRef decode(BlockAllocator &balloc, InputIt first, InputIt last) {
+std::span<const uint8_t> decode(BlockAllocator &balloc, InputIt first,
+ InputIt last) {
auto len = std::distance(first, last);
if (len % 4 != 0) {
- return StringRef::from_lit("");
+ return {};
}
auto iov = make_byte_ref(balloc, len / 4 * 3 + 1);
- auto p = iov.base;
+ auto p = std::begin(iov);
p = decode(first, last, p);
*p = '\0';
- return StringRef{iov.base, p};
+ return {std::begin(iov), p};
}
} // namespace base64