Base.h 934 B

1234567891011121314151617181920212223242526272829
  1. #ifndef BASE_H__
  2. #define BASE_H__
  3. #include <inttypes.h>
  4. #include <string>
  5. #include <iostream>
  6. namespace i2p {
  7. namespace data {
  8. size_t ByteStreamToBase64 (const uint8_t * InBuffer, size_t InCount, char * OutBuffer, size_t len);
  9. size_t Base64ToByteStream (const char * InBuffer, size_t InCount, uint8_t * OutBuffer, size_t len );
  10. const char * GetBase32SubstitutionTable ();
  11. const char * GetBase64SubstitutionTable ();
  12. size_t Base32ToByteStream (const char * inBuf, size_t len, uint8_t * outBuf, size_t outLen);
  13. size_t ByteStreamToBase32 (const uint8_t * InBuf, size_t len, char * outBuf, size_t outLen);
  14. /**
  15. Compute the size for a buffer to contain encoded base64 given that the size of the input is input_size bytes
  16. */
  17. size_t Base64EncodingBufferSize(const size_t input_size);
  18. std::string ToBase64Standard (const std::string& in); // using standard table, for Proxy-Authorization
  19. } // data
  20. } // i2p
  21. #endif