scan_asn1dertag(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

🌸 scan_asn1dertag β€” a libowfat moment πŸ’–

okay bestie, welcome to the Library Functions Manual, specifically the scan_asn1dertag(3) page ✨ β€” yes the manual name is literally right there in the header, we're not copy-pasting it, we're referencing it, periodt.


✨ NAME ✨

scan_asn1dertag β€” decode an unsigned integer from ASN.1 DER length encoding πŸŽ€


πŸ¦‹ SYNTAX πŸ¦‹

lowkey the whole thing is this:

#include <libowfat/scan.h>

size_t scan_asn1dertag(const char *src,size_t len,unsigned long long
*dest);

πŸ’… DESCRIPTION πŸ’…

so scan_asn1dertag decodes an unsigned integer in ASN.1 DER tag encoding from a memory area holding binary data. it writes the decoded value into dest and returns the number of bytes it read from src. that's the whole vibe. it's giving scanner. πŸ”₯

and listen, it's polite about it: scan_asn1dertag never reads more than len bytes from src. if the sequence is longer than that, or if the memory area contains an invalid sequence, it returns 0 and does not touch dest. so like… no mess, no drama, dest stays exactly how it was. iconic behavior honestly. πŸ’–

okay the numbers part, pay attention bestie: the length of the longest ASN.1 DER length sequence is 128 bytes. in practice the largest sequence is sizeof(*dest)+1. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘


aaaand that's the page!! ⭐ remember: scan_asn1dertag(3), from the Library Functions Manual, in all its libowfat glory β€” no version stamp, no date, just vibes and a signature line that says the exact same thing as the top did πŸ’€. mwah, go decode something. πŸŽ€πŸ’œ