logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

oath_base32_encode - API function

Arguments

const char * in input string with binary data of length inlen size_t inlen length of input data in char ** out pointer to newly allocated output string of length outlen, or NULL size_t * outlen pointer to output variable holding length of out, or NULL

Description

Encode binary data into a string with base32 data. The in parameter should contain inlen bytes of data to encode. The function allocates a new string in *out to hold the encoded data, and sets *outlen to the length of the data. The output string *out is zero-terminated (ASCII NUL), but the NUL is not counted in *outlen. If out is NULL, then *outlen will be set to what would have been the length of *out on successful encoding. If the caller is not interested in knowing the length of the output data out, then outlen may be set to NULL. It is permitted but useless to have both out and outlen NULL.

Name

oath_base32_encode - API function

Reporting Bugs

Report bugs to <oath-toolkit-help@nongnu.org>. liboath home page: https://www.nongnu.org/oath-toolkit/ General help using GNU software: http://www.gnu.org/gethelp/

Returns

On success OATH_OK (zero) is returned, OATH_BASE32_OVERFLOW is returned if the output would be too large to store, and OATH_MALLOC_ERROR is returned on memory allocation errors.

Since

1.12.0

Synopsis

#include<oath.h>intoath_base32_encode(constchar*in,size_tinlen,char**out,size_t*outlen);

See Also