man-pages/man3/a64l.3

79 lines
1.6 KiB
Groff
Raw Normal View History

2004-11-03 13:51:07 +00:00
.\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.\"
.\" Corrected, aeb, 2002-05-30
.\"
.TH A64L 3 2007-07-26 "" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
a64l, l64a \- convert between long and base-64
2004-11-03 13:51:07 +00:00
.SH SYNOPSIS
.B #include <stdlib.h>
.sp
.BI "long a64l(char *" str64 );
.sp
.BI "char *l64a(long " value );
.sp
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.sp
.BR a64l (),
.BR l64a ():
_SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500
2004-11-03 13:51:07 +00:00
.SH DESCRIPTION
These functions provide a conversion between 32-bit long integers
and little-endian base-64 ASCII strings (of length zero to six).
If the string used as argument for
.BR a64l ()
has length greater than six, only the first six bytes are used.
2007-06-25 10:03:10 +00:00
If the type
.I long
has more than 32 bits, then
2004-11-03 13:51:07 +00:00
.BR l64a ()
uses only the low order 32 bits of
.IR value ,
and
.BR a64l ()
sign-extends its 32-bit result.
.LP
2007-12-23 21:48:05 +00:00
The 64 digits in the base-64 system are:
2004-11-03 13:51:07 +00:00
.RS
.nf
2007-04-05 12:36:57 +00:00
2008-06-09 15:49:35 +00:00
\&\(aq.\(aq represents a 0
\&\(aq/\(aq represents a 1
2004-11-03 13:51:07 +00:00
0-9 represent 2-11
A-Z represent 12-37
a-z represent 38-63
2007-04-05 12:36:57 +00:00
2004-11-03 13:51:07 +00:00
.fi
.RE
So 123 = 59*64^0 + 1*64^1 = "v/".
.SH "CONFORMING TO"
POSIX.1-2001.
2004-11-03 13:51:07 +00:00
.SH NOTES
The value returned by
.BR a64l ()
may be a pointer to a static buffer, possibly overwritten
by later calls.
.LP
The behavior of
2004-11-03 13:51:07 +00:00
.BR l64a ()
is undefined when
.I value
is negative.
If
2004-11-03 13:51:07 +00:00
.I value
is zero, it returns an empty string.
.LP
These functions are broken in glibc before 2.2.5
(puts most significant digit first).
.LP
This is not the encoding used by
.BR uuencode (1).
.SH "SEE ALSO"
.BR uuencode (1),
.\" .BR itoa (3),
2004-11-03 13:51:07 +00:00
.BR strtoul (3)