Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include "ToBase64.h" // string, experimental/string_view
  2.  
  3. using std::length_error; // stdexcept
  4. using std::string; // string
  5. using std::experimental::string_view; // experimental/string_view
  6. using std::uint8_t; // cinttypes
  7.  
  8. using namespace std;
  9.  
  10. string to_base64(const string_view input)
  11.  
  12. string to_base64(const string_view input);
  13. string to_base64(string_view input);
  14.  
  15. auto remainder{ 0 };
  16. uint8_t leftover{ 0 };
  17.  
  18. auto remainder = 0;
  19. auto leftover = uint8_t(0);
  20.  
  21. int remainder = 0;
  22. uint8_t leftover = 0;
  23.  
  24. switch ((remainder %= 3)++)
  25.  
  26. output += "==";
  27. // ...
  28. output += '=';
  29.  
  30. output += "==n";
  31. // ...
  32. output += '=n'; // oops
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement