RQ_DECODE(3)
β¨ RQ_DECODE(3) β¨
okay bestie, welcome to the Librecast Programmer's Manual π you're about to learn how to decode a RaptorQ block and honestly? iconic behavior.
πΈ NAME πΈ
rq_decode β decode RaptorQ block π¦
π SYNOPSIS π
#include <lcrq.h>
int rq_decode(rq_t *rq, uint8_t *dec, uint8_t *enc, uint32_t ESI[], uint32_t nesi);
Compile and link with -llcrq. yes queen, that's the whole vibe π
π DESCRIPTION π
so this function decodes a RaptorQ block, using a variation of the method described in 5.4.2 of RFC6330. it's giving "I read the spec so you don't have to" energy, fr fr.
rqβ must be a pointer to a validrq_tcontext. like, an actual real one. not a fake one. π«Άdecβ a pointer to a buffer of at leastT x Kbytes. the decoded data gets written here. this is the glow-up destination, the main character buffer πencβ a pointer to the encoded block.ESI[]β the ESI index. it's an array of ESIs, and they need to be in the same order as the encoding symbols inenc. order matters bestie, do not shuffle πnesiβ The Loch Ness Monster. or the number of decoding symbols. preferably the latter. π (this manpage is hilarious, I don't make the rules)
π₯ RETURN VALUE π₯
On success, 0 is returned. If decoding fails, the function returns -1. that's it, that's the whole drama π
β EXAMPLE β
/* symbols are received into enc, with their respective ESIs written to ESI
* OH is the number of extra (overhead) symbols in addition to the
* required K' (KP) symbols.
* Now we can decode the object into the pre-allocated buffer dec.
*/
for (uint8_t sbn = 0; sbn < rq_Z(rq); sbn++) {
rq_decode(rq, dec, enc[sbn], ESI[sbn], KP + OH);
}
look at that loop go. slay. β¨
π SEE ALSO π
LCRQ Β· 2022-07-07 Β· RQ_DECODE(3)
and that's the page bestie π this was the Librecast Programmer's Manual, dated 2022-07-07, from the LCRQ source, and you absolutely ate. go decode something. periodt. ππ¦β¨
π¦ where this page comes from
- debian trixie: liblcrq0.0 0.2.3-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: lcrq 0.3.1
- nixpkgs unstable: lcrq 0.4.1
- ubuntu noble: liblcrq0.0 0.1.2-1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblcrq0.0 0.2.3-1
- ubuntu resolute: liblcrq0.0 0.3.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblcrq0.0 0.3.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms