Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

paolostivanin/libbaseencode

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
January 8, 2023 15:59
src
January 4, 2023 16:50
December 29, 2021 09:00
September 28, 2017 21:08
January 10, 2023 09:28
January 9, 2023 16:58

libbaseencode (deprecated since libcotp 2.0.0)

Coverity Scan Build Status

Library written in C for encoding and decoding data using base32 or base64 according to RFC-4648

⚠️ libbasencode is deprecated since libcotp 2.0.0 has been released. ⚠️

Requiremens

  • GCC or Clang
  • CMake

Build and Install

$ git clone https://github.com/paolostivanin/libbaseencode.git
$ cd libbaseencode
$ mkdir build && cd $_
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../
$ make
# make install

How To Use It

char *b32_encoded = base32_encode(unsigned char *input, size_t input_length, baseencode_error_t *err);

unsigned char *b32_decoded = base32_decode(char *input, size_t input_length, baseencode_error_t *err);

char *b64_encoded = base64_encode(unsigned char *input, size_t input_length, baseencode_error_t *err);

unsigned char *b64_decoded = base64_decode(char *input, size_t input_length, baseencode_error_t *err);

Please note that all the returned value must be freed once not needed any more.

Errors

In case of errors, NULL is returned and err is set to either one of:

INVALID_INPUT, EMPTY_STRING, INPUT_TOO_BIG, INVALID_B32_DATA, INVALID_B64_DATA, MEMORY_ALLOCATION,

otherwise, err is set to SUCCESS

About

Library written in C for encoding and decoding data using base32 or base64 (RFC-4648)

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published