]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/a64l.3
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
[thirdparty/man-pages.git] / man3 / a64l.3
1 .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\"
4 .\" Corrected, aeb, 2002-05-30
5 .\"
6 .TH A64L 3 2002-02-15 "" "Linux Programmer's Manual"
7 .SH NAME
8 a64l, l64a \- convert between long and base-64
9 .SH SYNOPSIS
10 .B #include <stdlib.h>
11 .sp
12 .BI "long a64l(char *" str64 );
13 .sp
14 .BI "char *l64a(long " value );
15 .SH DESCRIPTION
16 These functions provide a conversion between 32-bit long integers
17 and little-endian base-64 ASCII strings (of length zero to six).
18 If the string used as argument for
19 .BR a64l ()
20 has length greater than six, only the first six bytes are used.
21 If longs have more than 32 bits, then
22 .BR l64a ()
23 uses only the low order 32 bits of
24 .IR value ,
25 and
26 .BR a64l ()
27 sign-extends its 32-bit result.
28 .LP
29 The 64 digits in the base 64 system are:
30 .RS
31 .nf
32
33 \&'.' represents a 0
34 \&'/' represents a 1
35 0-9 represent 2-11
36 A-Z represent 12-37
37 a-z represent 38-63
38
39 .fi
40 .RE
41 So 123 = 59*64^0 + 1*64^1 = "v/".
42 .SH NOTES
43 The value returned by
44 .BR a64l ()
45 may be a pointer to a static buffer, possibly overwritten
46 by later calls.
47 .LP
48 The behaviour of
49 .BR l64a ()
50 is undefined when
51 .I value
52 is negative.
53 If
54 .I value
55 is zero, it returns an empty string.
56 .LP
57 These functions are broken in glibc before 2.2.5
58 (puts most significant digit first).
59 .LP
60 This is not the encoding used by
61 .BR uuencode (1).
62 .SH "CONFORMING TO"
63 POSIX.1-2001.
64 .SH "SEE ALSO"
65 .BR uuencode (1),
66 .BR itoa (3),
67 .BR strtoul (3)