BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet 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 }
fc
Definition: api.hpp:15
zlib.hpp
fc::zlib_compress
std::string zlib_compress(const std::string &in)
Definition: zlib.cpp:7