1A64L(3) Linux Programmer's Manual A64L(3)
2
3
4
5
6
8 a64l, l64a - convert between long and base-64
9
11 #include <stdlib.h>
12
13 long a64l(const char *str64);
14
15 char *l64a(long value);
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 a64l(), l64a():
20 _XOPEN_SOURCE >= 500
21 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
22 || /* Glibc versions <= 2.19: */ _SVID_SOURCE
23
25 These functions provide a conversion between 32-bit long integers and
26 little-endian base-64 ASCII strings (of length zero to six). If the
27 string used as argument for a64l() has length greater than six, only
28 the first six bytes are used. If the type long has more than 32 bits,
29 then l64a() uses only the low order 32 bits of value, and a64l() sign-
30 extends its 32-bit result.
31
32 The 64 digits in the base-64 system are:
33
34 '.' represents a 0
35 '/' represents a 1
36 0-9 represent 2-11
37 A-Z represent 12-37
38 a-z represent 38-63
39
40 So 123 = 59*64^0 + 1*64^1 = "v/".
41
43 For an explanation of the terms used in this section, see
44 attributes(7).
45
46 ┌──────────┬───────────────┬─────────────────────┐
47 │Interface │ Attribute │ Value │
48 ├──────────┼───────────────┼─────────────────────┤
49 │l64a() │ Thread safety │ MT-Unsafe race:l64a │
50 ├──────────┼───────────────┼─────────────────────┤
51 │a64l() │ Thread safety │ MT-Safe │
52 └──────────┴───────────────┴─────────────────────┘
54 POSIX.1-2001, POSIX.1-2008.
55
57 The value returned by l64a() may be a pointer to a static buffer, pos‐
58 sibly overwritten by later calls.
59
60 The behavior of l64a() is undefined when value is negative. If value
61 is zero, it returns an empty string.
62
63 These functions are broken in glibc before 2.2.5 (puts most significant
64 digit first).
65
66 This is not the encoding used by uuencode(1).
67
69 uuencode(1), strtoul(3)
70
72 This page is part of release 4.15 of the Linux man-pages project. A
73 description of the project, information about reporting bugs, and the
74 latest version of this page, can be found at
75 https://www.kernel.org/doc/man-pages/.
76
77
78
79 2016-03-15 A64L(3)