BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
zlib.cpp
Go to the documentation of this file.
1 #include <fc/compress/zlib.hpp>
2 
3 #include "miniz.c"
4 
5 namespace fc
6 {
7  std::string zlib_compress(const std::string& in)
8  {
9  size_t compressed_message_length;
10  char* compressed_message = (char*)tdefl_compress_mem_to_heap(in.c_str(), in.size(), &compressed_message_length, TDEFL_WRITE_ZLIB_HEADER | TDEFL_DEFAULT_MAX_PROBES);
11  std::string result(compressed_message, compressed_message_length);
12  free(compressed_message);
13  return result;
14  }
15 }
std::string zlib_compress(const std::string &in)
Definition: zlib.cpp:7
Definition: api.hpp:15