MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / GzipNoCompression

Function GzipNoCompression

libi2pd/Gzip.cpp:168–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 }
167
168 size_t GzipNoCompression (const uint8_t * in, uint16_t inLen, uint8_t * out, size_t outLen)
169 {
170 static const uint8_t gzipHeader[11] = { 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x01 };
171 if (outLen < (size_t)inLen + 23) return 0;
172 memcpy (out, gzipHeader, 11);
173 htole16buf (out + 11, inLen);
174 htole16buf (out + 13, 0xffff - inLen);
175 memcpy (out + 15, in, inLen);
176 htole32buf (out + inLen + 15, crc32 (0, in, inLen));
177 htole32buf (out + inLen + 19, inLen);
178 return inLen + 23;
179 }
180
181 size_t GzipNoCompression (const std::vector<std::pair<const uint8_t *, size_t> >& bufs, uint8_t * out, size_t outLen)
182 {

Callers 3

CreateDatabaseStoreMsgFunction · 0.85
CreateDataMessageMethod · 0.85
CreateDataMessageMethod · 0.85

Calls 2

htole16bufFunction · 0.85
htole32bufFunction · 0.85

Tested by

no test coverage detected