fmt_asn1derlength(3)
π fmt_asn1derlength(3) π
okay bestie, gather round, it's a Library Functions Manual moment and we're about to get into it β¨
πΈ NAME πΈ
fmt_asn1derlength β encode unsigned integer like ASN.1 DER length π
β¨ SYNTAX β¨
#include <libowfat/fmt.h>
size_t fmt_asn1derlength(char *dest,unsigned long long source);
π¦ DESCRIPTION π¦
so like. fmt_asn1derlength encodes an unsigned integer using the ASN.1 DER rules for encoding tag lengths. no cap, that's the whole job. π
the way this works, it can take anywhere from 1 byte (for the range 0-0x7f) all the way up to sizeof(source)+1 bytes. so it's giving flexible. it's giving adaptive. it's giving main character energy. π
if dest equals FMT_LEN (i.e. it's NULL), then fmt_asn1derlength doesn't write anything β it just returns the number of bytes it would have written. lowkey the most useful trick ever. like, "hey how much room do i need?" and it just tells you. obsessed. π
and for convenience (bestie behaviour fr fr), fmt.h defines the integer FMT_ASN1LENGTH to be big enough to contain every possible fmt_asn1derlength output. so you never have to guess at your buffer size. slay. π«Ά
π SEE ALSO π
scan_asn1derlength(3)β the reverse vibe, go check it out β¨
okay that's the whole page, you ate that π stay iconic, read your man pages, hydrate, and remember: this one came from the Library Functions Manual β fmt_asn1derlength(3) β and there's no date line on it so we're just vibing with the source, periodt π
π
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms