1 .\" Copyright (c) 2022 The DragonFly Project. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in
11 .\" the documentation and/or other materials provided with the
13 .\" 3. Neither the name of The DragonFly Project nor the names of its
14 .\" contributors may be used to endorse or promote products derived
15 .\" from this software without specific, prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
27 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 .Nd base64 encode and decode
44 .Fa "const unsigned char *src"
45 .Fa "size_t srclength"
52 .Fa "unsigned char *target"
57 encodes the input data
61 and writes the encoded string to
67 should be big enough to hold the encoded string,
68 including the terminating NUL character.
71 holds the encoded string and its length
72 (without accounting for the NUL terminator) is returned.
73 Otherwise, a value of \-1 is returned.
76 decodes the base64 string
78 and writes the decoded data to
84 holds the decoded data and its length is returned.
85 Otherwise, a value of \-1 is returned.
91 returns the required length to hold the decoded data.
95 functions return the length of the result if successful;
96 otherwise the value \-1 is returned.
103 .%T "MIME (Multipurpose Internet Mail Extensions) Part One"
108 functions appeared in
112 This manual page was written by
113 .An Aaron LI Aq Mt aly@aaronly.me .