1oath_base32_encode(3) liboath oath_base32_encode(3)
2
3
4
6 oath_base32_encode - API function
7
9 #include <oath.h>
10
11 int oath_base32_encode(const char * in, size_t inlen, char ** out,
12 size_t * outlen);
13
15 const char * in
16 input string with binary data of length inlen
17
18 size_t inlen
19 length of input data in
20
21 char ** out pointer to newly allocated output string of length outlen,
22 or NULL
23
24 size_t * outlen
25 pointer to output variable holding length of out, or NULL
26
28 Encode binary data into a string with base32 data.
29
30 The in parameter should contain inlen bytes of data to encode. The
31 function allocates a new string in *out to hold the encoded data, and
32 sets *outlen to the length of the data. The output string *out is
33 zero-terminated (ASCII NUL), but the NUL is not counted in *outlen.
34
35 If out is NULL, then *outlen will be set to what would have been the
36 length of *out on successful encoding.
37
38 If the caller is not interested in knowing the length of the output
39 data out, then outlen may be set to NULL.
40
41 It is permitted but useless to have both out and outlen NULL.
42
44 On success OATH_OK (zero) is returned, OATH_BASE32_OVERFLOW is returned
45 if the output would be too large to store, and OATH_MALLOC_ERROR is re‐
46 turned on memory allocation errors.
47
49 1.12.0
50
52 Report bugs to <oath-toolkit-help@nongnu.org>. liboath home page:
53 https://www.nongnu.org/oath-toolkit/ General help using GNU software:
54 http://www.gnu.org/gethelp/
55
57 Copyright © 2009-2020 Simon Josefsson.
58 Copying and distribution of this file, with or without modification,
59 are permitted in any medium without royalty provided the copyright no‐
60 tice and this notice are preserved.
61
62
63
64liboath 2.6.9 oath_base32_encode(3)