Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../.././../../../usr/man/man3c/b64_encode.3c
Real path: /usr/share/man/man3c/b64_encode.3c
Zurück
'\" te .\" Copyright (c) 2016, 2022, Oracle and/or its affiliates. .TH b64_encode 3C "28 Feb 2022" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME b64_encode, b64_decode, b32_encode, b32_decode \- encode and decode a string in base64 or base32 .SH SYNOPSIS .LP .nf #include <string.h> \fBssize_t\fR \fBb64_encode\fR(\fBchar restrict *\fR\fIoutbuf\fR, \fBsize_t\fR \fIoutbufsz\fR, \fBconst void restrict *\fR\fIinbuf\fR, \fBsize_t\fR \fIinbufsz\fR, \fBconst char *\fR\fIalphabet\fR, \fBuint64_t\fR \fIflags\fR); \fBssize_t\fR \fBb64_decode\fR(\fBvoid *\fR\fIoutbuf\fR, \fBsize_t\fR \fIoutbufsz\fR, \fBconst char *\fR\fIinbuf\fR, \fBconst char *\fR\fIalphabet\fR, \fBuint64_t\fR \fIflags\fR); \fBssize_t\fR \fBb32_encode\fR(\fBchar restrict *\fR\fIoutbuf\fR, \fBsize_t\fR \fIoutbufsz\fR, \fBconst void restrict *\fR\fIinbuf\fR, \fBsize_t\fR \fIinbufsz\fR, \fBconst char *\fR\fIalphabet\fR, \fBuint64_t\fR \fIflags\fR); \fBssize_t\fR \fBb32_decode\fR(\fBvoid *\fR\fIoutbuf\fR, \fBsize_t\fR \fIoutbufsz\fR, \fBconst char *\fR\fIinbuf\fR, \fBconst char *\fR\fIalphabet\fR, \fBuint64_t\fR \fIflags\fR); \fBconst char *BASE64_URL_ALPHABET\fR; \fBconst char *BASE32_HEX_ALPHABET\fR; .fi .SH DESCRIPTION .sp .LP These functions convert sequences of bytes to and from single-byte character strings using the Base64 and Base32 encoding schemes defined in \fIRFC 4648\fR. By default, the characters used in the strings are a subset of the US-ASCII printable character set. .sp .ne 2 .mk .na \fB\fBb64_encode()\fR, \fBb32_encode()\fR\fR .ad .br .sp .6 .RS 4n The argument \fIinbuf\fR points to an array of bytes, the argument \fIoutbuf\fR points to a string which is an array of characters with a terminating null character, and \fIinbufsz\fR and \fIoutbufsz\fR are their sizes, respectively. The argument \fIflags\fR is currently unused and is set to \fB0\fR. .sp The \fIalphabet\fR argument allows the caller to supply a customized encoding alphabet string. This is comprised of the encoding characters, followed by the pad character, followed by a \fBnull\fR terminator. Passing \fBNULL\fR for this argument allows the standard character set to be used. For \fBb64_encode()\fR function, this string is exactly 65 characters long, for \fBb32_encode()\fR function, it is 33 characters long, excluding the terminator. The alternate encoding alphabets, base64 "URL and filename safe" and base32 "extended hex" described in RFC 4648 are available as the constant strings \fBBASE64_URL_ALPHABET\fR and \fBBASE32_HEX_ALPHABET\fR. .sp These functions encode the contents of \fIinbuf\fR in base64 or base32, and copy the result into \fIoutbuf\fR as a null-terminated string. The functions do not write more than the \fIoutbufsz\fR bytes. To avoid an error condition, the size of the array pointed to by \fIoutbuf\fR must be large enough to contain the encoding of the string pointed to by \fIinbuf\fR along with a terminating null character. .RE .sp .ne 2 .mk .na \fB\fBb64_decode()\fR, \fBb32_decode()\fR\fR .ad .br .sp .6 .RS 4n The argument \fIinbuf\fR points to a string, which is an array of characters terminated by a null character. The argument \fIoutbuf\fR points to an array of bytes, and \fIoutbufsz\fR is the size of \fIoutbuf\fR. The argument \fIflags\fR is currently unused and is set to \fB0\fR. .sp The \fIalphabet\fR argument functions exactly as for b64_encode or b32encode. .sp These functions decode the contents of \fIinbuf\fR from base64 or base32 and write the output to \fIoutbuf\fR as an array of bytes. Newline characters and whitespace are allowed in the input data and are ignored, but any other characters that are not part of the base64 alphabet will result in an error condition. Both functions will not write more than \fIoutbufsz\fR bytes. To avoid an error condition, the size of the array pointed to by \fIoutbuf\fR must be large enough to contain the decoding of the string pointed to by \fIinbuf\fR. .RE .SH RETURN VALUES .sp .LP Upon successful completion, the functions return the number of bytes written. The functions return \fB-1\fR in an error condition. If \fIoutbuf\fR is a null pointer and \fIoutbufsz\fR is \fB0\fR, then instead of returning the number of bytes written, an estimate of the number of bytes required to hold the output string or data is returned. This estimate is guaranteed to be at least as large as the size of the actual output. .SH ERRORS .sp .LP The \fBb64_encode()\fR and \fBb32_encode()\fR functions will fail if: .sp .ne 2 .mk .na \fB\fBEOVERFLOW\fR\fR .ad .RS 13n .rt \fIoutbuf\fR is not large enough to hold the output string .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 13n .rt an invalid custom \fIalphabet\fR string is supplied .RE .sp .LP The \fBb64_decode()\fR and \fBb32_decode()\fR functions will fail if: .sp .ne 2 .mk .na \fB\fBEOVERFLOW\fR\fR .ad .RS 13n .rt \fBoutbuf\fR is not large enough to hold the output data .RE .sp .ne 2 .mk .na \fB\fBEBADMSG\fR\fR .ad .RS 13n .rt illegal character(s) in the input string .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 13n .rt an invalid custom \fIalphabet\fR string is supplied .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ Standard None .TE .sp .SH SEE ALSO .sp .LP \fBuuencode\fR(1C), \fBascii\fR(7) .sp .LP Josefsson, S. \fIRFC 4648: The Base16, Base32, and Base64 Data Encodings\fR. October 2006. https://tools.ietf.org/html/rfc4648 .SH HISTORY .sp .LP The \fBb64_encode()\fR, \fBb64_decode()\fR, \fBb32_encode()\fR, and \fBb32_decode()\fR functions were added to Oracle Solaris in the 11.4.0 release.