This commit is contained in:
Tom Vercauteren 2024-02-14 09:32:27 +00:00
parent dc5b927054
commit 822fff1bc4
2 changed files with 10 additions and 3 deletions

View File

@ -5,13 +5,19 @@ Header only library.
## Usage
```cpp
#include "base64.hpp"
#include <iostream>
#include "base64.hpp"
int main() {
auto base64= to_base64("Hello, World!");
std::cout << base64 << '\n'; // SGVsbG8sIFdvcmxkIQ==
std::cout << base64 << std::endl; // SGVsbG8sIFdvcmxkIQ==
auto s = from_base64("SGVsbG8sIFdvcmxkIQ==");
std::cout << s << '\n'; // Hello, World!
std::cout << s << std::endl; // Hello, World!
}
```
## Notes
This library relies on C++17.
A different, unrelated C++20 library for base64 encoding/decoding can be found at https://github.com/matheusgomes28/base64pp

View File

@ -2,6 +2,7 @@
#define BASE64_HPP_
#include <algorithm>
#include <cstdint>
#include <stdexcept>
#include <string>
#include <string_view>