LZ4_compress_HC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to the LZ4_compress_HC(9) page from the Kernel API Manual β€” it’s all about compressing data from src into dst with the HC algorithm, and the whole vibe is β€œpowerful but slower, know what you’re doing” πŸ’…βœ¨

πŸ’– NAME πŸ’–

LZ4_compress_HC β€” compress data from src into dst, using the HC algorithm.

✨ SYNOPSIS ✨

int LZ4_compress_HC (const char *src , char *dst , int srcSize , int
dstCapacity , int compressionLevel , void *wrkmem );

🫢 ARGUMENTS 🫢

  • src β€” source address of the original data. This is where the uncomressed data lives, bestie πŸ“
  • dst β€” output buffer address of the compressed data. This is where the glow-up happens πŸ’–
  • srcSize β€” size of the input data. Max supported value is LZ4_MAX_INPUT_SIZE, so don’t try to be extra beyond that πŸ™ˆ
  • dstCapacity β€” full or partial size of buffer 'dst', which must be already allocated. Like, allocate first, compress second, no shortcuts πŸŽ€
  • compressionLevel β€” recommended values are between 4 and 9, although any value between 1 and LZ4HC_MAX_CLEVEL will work. Values >LZ4HC_MAX_CLEVEL behave the same as 16. Lowkey pick your level with intention πŸ’…
  • wrkmem β€” address of the working memory. This requires 'wrkmem' of size LZ4HC_MEM_COMPRESS. Don’t forget the scratch space, bestie 🧠✨

πŸ¦‹ DESCRIPTION πŸ¦‹

Compress data from 'src' into 'dst', using the more powerful but slower "HC" algorithm. It’s giving main character compression β€” stronger, but it takes its time 🌸

Compression is guaranteed to succeed if dstCapacity >= LZ4_compressBound(srcSize). That’s the capacity check to care about, fr fr πŸ”₯

πŸŽ€ RETURN πŸŽ€

the number of bytes written into 'dst' or 0 if compression fails. So if you get 0, bestie, it did not slay πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./include/linux/lz4.h β€” and please also peek at these iconique pages:

okay that’s the whole page, bestie β€” from ./include/linux, dated October 2026, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from