cmBase32.h 811 B

123456789101112131415161718192021222324252627282930313233
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmBase32_h
  4. #define cmBase32_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <stddef.h>
  7. #include <string>
  8. /** \class cmBase32Encoder
  9. * \brief Encodes a byte sequence to a Base32 byte sequence according to
  10. * RFC4648
  11. *
  12. */
  13. class cmBase32Encoder
  14. {
  15. public:
  16. static const char paddingChar = '=';
  17. public:
  18. cmBase32Encoder();
  19. ~cmBase32Encoder();
  20. // Encodes the given input byte sequence into a string
  21. // @arg input Input data pointer
  22. // @arg len Input data size
  23. // @arg padding Flag to append "=" on demand
  24. std::string encodeString(const unsigned char* input, size_t len,
  25. bool padding = true);
  26. };
  27. #endif