a64l(3)
π a64l β the base-64 glow-up page (section 3 of the manual, bestie)
okay so you found yourself a a64l(3) page and you're like "what even is this" β don't worry, I got you. This is the Library Functions Manual entry for a64l and l64a, and by the end you're gonna be converting longs to base-64 like it's nothing. no cap. β¨
πΈ NAME πΈ
a64l, l64a β convert between long and base-64
π LIBRARY π
Standard C library (libc, -lc)
β¨ SYNOPSIS β¨
#include <stdlib.h>
long a64l(const char *str64);
char *l64a(long value);
π Feature Test Macro Requirements for glibc π
(peep feature_test_macros(7) for the tea, bestie)
a64l(), l64a():
_XOPEN_SOURCE >= 500
|| /* glibc >= 2.19: */ _DEFAULT_SOURCE
|| /* glibc <= 2.19: */ _SVID_SOURCE
π DESCRIPTION π
So like, these two functions are a little conversion duo π«Ά β they take you back and forth between 32-bit long integers and little-endian base-64 ASCII strings. And those strings? They're length zero to six. Yep, tiny. adorable.
Couple things you gotta know:
- If the string you hand to
a64l()is longer than six, it literally only looks at the first six bytes. the rest? ignored. π - If your type
longhas more than 32 bits, thenl64a()only uses the low order 32 bits of value, anda64l()sign-extends its 32-bit result.
π’ the 64 digits in the base-64 system π’
this is the whole alphabet, memorize it, it's giving secret code:
'.' represents a 0
'/' represents a 1
0-9 represent 2-11
A-Z represent 12-37
a-z represent 38-63
and here's the flex that makes it click:
So 123 = 59*64^0 + 1*64^1 = "v/".
see?? 59 is v and 1 is /. math ate. π₯
π ATTRIBUTES π
for an explanation of the terms used in this section, go look at attributes(7). But here's the breakdown:
l64a()β Thread safety:MT-Unsafe race:l64aπ (yeah. she's got a race condition. we'll get to that)a64l()β Thread safety:MT-Safeπ
β STANDARDS β
POSIX.1-2008.
π HISTORY π
POSIX.1-2001.
π NOTES π
okay bestie, here's the important stuff, read every line:
- The value returned by
l64a()may be a pointer to a static buffer, and it can possibly be overwritten by later calls. so don't be out here holding onto it like it's yours. π - The behavior of
l64a()is undefined when value is negative. fr fr, don't do it. - If value is zero, it returns an empty string. cute, minimal, iconic.
- Heads up: these functions were broken before glibc 2.2.5 β they put the most significant digit first. wrong order bestie, we don't stan.
- And one more: this is not the encoding used by
uuencode(1). not the same thing. don't mix them up or you'll be sad. π₯²
π¦ SEE ALSO π¦
okay that's the whole page, you're officially a base-64 girlie now, go forth and convert π this was a64l(3) from Linux man-pages 6.20, dated 2026-02-08 β periodt. πβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-1.0-or-later
- Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms