a64lのヘルプ・マニュアル
日本語 英語
a64l --help
man a64l
A64L(3) Linux Programmer’s Manual A64L(3)
名前
a64l, l64a - long と base-64 を変換する
書式
#include
long a64l(char *str64);
char *l64a(long value);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
a64l(), l64a(): _SVID_SOURCE || _XOPEN_SOURCE >= 500
説明
これらの関数は 32 ビット long 整数とリトルエンディアン base-64 ASCII 文
字列 (長さ 0 〜 6) の間の変換を行う。 a64l() の引き数の文字列が 7 文 字
以上の場合、最初の 6 バイトが使われる。 long 型が 32 ビットより大きい場
合、 l64a() は value の下位 32 ビットのみを使い、 a64l() は 32 ビットの
結果を符号拡張 (sign-extend) する。
base-64 システムで使われる 64 個の文字は以下の通りである:
'.' は 0 を表す。
'/' は 1 を表す。
0-9 は 2-11 を表す。
A-Z は 12-37 を表す。
a-z は 38-63 を表す。
よって 123 = 59*64^0 + 1*64^1 = "v/" である。
準拠
POSIX.1-2001.
注意
a64l() で返される値は静的バッファへのポインタかもしれないので、以降の呼
び出しで上書きされる可能性がある。
value が負の場合、 l64a() の動作は定義されていない。 value が 0 の場 合
は空文字列を返す。
これらの関数は glibc 2.2.5 以前では間違っている (最上位デジットを最初に
している)。
これは uuencode(1) で使われるエンコーディングではない。
関連項目
uuencode(1), strtoul(3)
2007-07-26 A64L(3)
A64L(3) Linux Programmer’s Manual A64L(3)
NAME
a64l, l64a - convert between long and base-64
SYNOPSIS
#include
long a64l(char *str64);
char *l64a(long value);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
a64l(), l64a(): _SVID_SOURCE || _XOPEN_SOURCE >= 500
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 a64l() has length greater than six, only
the first six bytes are used. If the type long has more than 32 bits,
then l64a() uses only the low order 32 bits of value, and a64l() sign-
extends its 32-bit result.
The 64 digits in the base-64 system are:
'.' represents a 0
'/' represents a 1
0-9 represent 2-11
A-Z represent 12-37
a-z represent 38-63
So 123 = 59*64^0 + 1*64^1 = "v/".
CONFORMING TO
POSIX.1-2001.
NOTES
The value returned by a64l() may be a pointer to a static buffer, pos-
sibly overwritten by later calls.
The behavior of l64a() is undefined when value is negative. If value
is zero, it returns an empty string.
These functions are broken in glibc before 2.2.5 (puts most significant
digit first).
This is not the encoding used by uuencode(1).
SEE ALSO
uuencode(1), strtoul(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2007-07-26 A64L(3)