8000 GitHub - serge1/decenc: Binary-to-text encoding/decoding algorithms implemented in C++ · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2FGitHub.com%2Fserge1%2Fdecenc","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E\u0026source=header-repo\u0026source_repo=serge1%2Fdecenc","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://GitHub.com/serge1/decenc\",\"user_id\":null}}","auth_hydro_click_hmac":"64c21f9419715286857c2ebffecfd0187d0f523ddea034cd8f3d6b91682249ee"}}
serge1Public

About

Binary-to-text encoding/decoding algorithms implemented in C++

Resources

Stars

5 stars

Watchers

2 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

DECENC

CMake

Binary-to-text encoding algorithms implemented in C++

The header-only C++ library implements arbitrary binary data encoding and decoding to a number of ASCII formats in accordance to binary-to-text encoding schemes.


The Project Purpose

  • One-stop implementation for different binary-to-text schemes
  • Encoding/Decoding algorithms for both Internet and computer/EEPROM/Flash memory initialization
  • Modern realization in C++ language
  • Ease of use
  • Permissive licensing
  • Portability

The Project Priorities

  • Correctness
  • Usage simplicity
  • Adherence to C++ standards
  • Efficiency

The Project Name

The project name is built from words "Decoding" and "Encoding". But, I like to pronounce the name of the project as "decens" - a Latin word meaning "fitting", "appropriate", "worthy", "decent", "well-formed".

DECENC Design

The project implements a number of well-known encoding schemes. Due to the "header-only" and "template" nature of the implementation, only those algorithms that used in an application will be part of compiled executable file.

The main class decenc instantiates algorithm passed as a template parameter providing static polymorphism.

DECENC Usage

#include <decenc/decenc.hpp>

using namespace DECENC;               // Use DECENC namespace

...
std::string in("Hello");
std::string out;
...
decenc<base64> coder;                 // Choose encoding scheme
error err = coder.encode(in, out);    // Do encoding
if (!err.is_ok()) ...                 // Check for errors
...
coder.decode(out, in);                // Do decoding
if (!err.is_ok()) ...                 // Check for errors
...

Supported Schemes

Scheme Class Name Reference
Base16 base16 - RFC 4648
Base32 base32 - RFC 4648
Base32Hex base32hex - RFC 4648
Base64 base64 - RFC 4648
Base64URL base64url - RFC 4648
Base91 base91 - basE91 encoding
- A Proposal of Substitute for Base85/64 – Base91

Other links

Wikipedia "Binary-to-text encoding" article

Wikipedia: Base64 variants

Wikipedia: Base32 variants

About

Binary-to-text encoding/decoding algorithms implemented in C++

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages

0