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 long has more than 32 bits, then l64a() only uses the low order 32 bits of value, and a64l() 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms